Tutorials Logic, IN +91 8092939553 info@tutorialslogic.com
Navigation
Home About Us Contact Us Blogs FAQs
Tutorials
All Tutorials
Services
Academic Projects Resume Writing Interview Questions Website Development
Compiler Tutorials

Introduction

What is JavaScript?

JavaScript is a lightweight, interpreted, multi-paradigm programming language created by Brendan Eich in 1995 at Netscape. Originally named Mocha, then LiveScript, it was renamed JavaScript as a marketing decision. Today it is the world's most widely used programming language - the only language that runs natively in web browsers.

  • Client-side: Runs in the browser - manipulates DOM, handles events, validates forms
  • Server-side: Runs on Node.js - builds REST APIs, web servers, CLI tools
  • Mobile: React Native, Ionic - cross-platform mobile apps
  • Desktop: Electron - VS Code, Slack, Discord are built with it

JavaScript Versions (ECMAScript)

JavaScript is standardized by ECMA International as ECMAScript (ES). Since ES2015 (ES6), new versions are released annually.

VersionYearKey Features
ES52009strict mode, JSON, Array methods (forEach, map, filter)
ES6 / ES20152015let/const, arrow functions, classes, modules, promises, template literals
ES20162016Array.includes(), exponentiation operator (**)
ES20172017async/await, Object.entries(), Object.values()
ES20182018rest/spread for objects, Promise.finally(), async iteration
ES20192019Array.flat(), Array.flatMap(), Object.fromEntries()
ES20202020Optional chaining (?.), nullish coalescing (??), BigInt, Promise.allSettled()
ES20212021String.replaceAll(), Promise.any(), logical assignment (&&=, ||=, ??=)
ES20222022Array.at(), Object.hasOwn(), class fields, top-level await
ES20232023Array.findLast(), Array.toSorted(), Array.toReversed()
ES20242024Promise.withResolvers(), Object.groupBy(), Map.groupBy()

Your First JavaScript Program

Hello World
// In browser - open DevTools Console (F12) and type:
console.log('Hello, World!');

// In HTML file
// <script src="script.js"></script>
// or inline:
// <script>alert('Hello!');</script>

// Variables
let name = 'Alice';        // mutable
const age = 25;            // immutable
var old = 'avoid var';     // function-scoped (legacy)

// Template literals
console.log(`My name is ${name} and I am ${age} years old.`);

// Modern features
const user = { name: 'Bob', address: { city: 'Delhi' } };
console.log(user?.address?.city);  // Optional chaining: 'Delhi'
console.log(user?.phone ?? 'N/A'); // Nullish coalescing: 'N/A'

JavaScript vs Java

Despite the similar name, JavaScript and Java are completely different languages. JavaScript is dynamically typed, interpreted, and runs in browsers. Java is statically typed, compiled to bytecode, and runs on the JVM. The name similarity was purely a marketing decision in 1995.

Key Takeaways
  • JavaScript was created in 10 days by Brendan Eich in 1995 - originally called Mocha, then LiveScript.
  • ECMAScript is the official standard. ES6 (2015) was the biggest update - introduced classes, modules, arrow functions.
  • JavaScript is the only language that runs natively in all web browsers.
  • Node.js (2009) brought JavaScript to the server - enabling full-stack JS development.
  • Use let and const (ES6+) - avoid var which has confusing function-scoping behavior.

Ready to Level Up Your Skills?

Explore 500+ free tutorials across 20+ languages and frameworks.