JavaScript was created by Brendan Eich in 1995 in just 10 days. It runs in every browser, on servers via Node.js, and in mobile/desktop apps. It is **dynamically typed**, meaning variable types are determined at runtime.
1Understanding What is JavaScript
JavaScript was created by Brendan Eich in 1995 in just 10 days. It runs in every browser, on servers via Node.js, and in mobile/desktop apps. It is dynamically typed, meaning variable types are determined at runtime.
JavaScript !== Java. They are completely different languages.
// JavaScript runs in the browser and Node.js
console.log('Hello from JS!');
const add = (a, b) => a + b;
console.log(add(3, 7)); // 102Practical Example
Here is a real-world application of What is JavaScript showing how it is used in production JavaScript code.
// JS is event-driven
document.addEventListener('click', () => {
console.log('User clicked!');
});3Best Practices
Follow these guidelines when working with What is JavaScript:
1. Use 'use strict' to opt into stricter parsing
2. Prefer const and let over var
3. Keep functions small and focused
Tip: JavaScript !== Java. They are completely different languages.
// JavaScript runs in the browser and Node.js
console.log('Hello from JS!');
const add = (a, b) => a + b;
console.log(add(3, 7)); // 10