🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEjavascript

javascript Documentation

LOADING ENGINE...

What is JavaScript

AI & DATA SCIENCE // what-is-javascript

JavaScript is a lightweight, interpreted, prototype-based language with first-class functions. It is the programming language of the Web.

Syntax

// Variables, functions, objects and events
let x = 10;
const greet = (name) => `Hello, ${name}!`;
console.log(greet('World'));

Deep Dive Course

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.

editor.html
// 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
localhost:3000

2Practical Example

Here is a real-world application of What is JavaScript showing how it is used in production JavaScript code.

editor.html
// JS is event-driven
document.addEventListener('click', () => {
  console.log('User clicked!');
});
localhost:3000

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.

editor.html
// 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
localhost:3000

Examples

Example 01Basic Usage
// 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
Example 02Advanced Example
// JS is event-driven
document.addEventListener('click', () => {
  console.log('User clicked!');
});

Best Practices

  • Use 'use strict' to opt into stricter parsing
  • Prefer const and let over var
  • Keep functions small and focused

Interview Question

What is the difference between JavaScript and ECMAScript?

Hint: ECMAScript is the standard; JavaScript is the implementation.

ECMAScript (ES) is the specification defined by TC39. JavaScript is one implementation of that spec. ES6 (2015) introduced classes, arrow functions, modules, Promises, and more.

Exercises

MediumPractice using What is JavaScript in a real scenario.
View Solution
// 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

Frequently Asked Questions

What is the difference between JavaScript and ECMAScript?

ECMAScript (ES) is the specification defined by TC39. JavaScript is one implementation of that spec. ES6 (2015) introduced classes, arrow functions, modules, Promises, and more.

Related Functions

VariablesConstantsData-TypesBasic-Syntax