A Friendly Chat That Helped Me Understand JavaScript – Introduction to JavaScript

A Friendly Chat That Helped Me Understand JavaScript – Introduction to JavaScript

Here’s a short fictional story of two friends, Krish and Suman. Where Suman ask his doubts as questions and Krish answers to those questions.

What is JavaScript and what it does?

JavaScript is a high-level, interpreted programming language. It allows you to write logic that runs directly inside your browser and is key to building interactive web applications.

High-level means you don’t have to worry about memory management, registers, or hardware-related tasks. The language abstracts those low-level details for you.
Interpreted means the browser reads and executes your code line-by-line, without compiling it into machine code beforehand.

Where is JavaScript actually used today?

JavaScript is used everywhere from personal portfolio websites to large-scale applications by global companies. For example:

  • Google uses JavaScript in services like Gmail, Docs, and YouTube.
  • Netflix uses it (React.js) to handle interactive user interfaces.
  • PayPal uses for payment processing on websites and applications.
  • Facebook (Meta) developed React, a popular frontend JavaScript library and used for UI.

Why was JavaScript even invented?

Back in 1995, websites were static. In simple terms, users could read information, but websites but couldn’t respond to user actions like clicks or inputs.

To solve this, Netscape wanted a lightweight scripting language that could:

  • Run in the browser
  • Respond to user input
  • Be easy for beginners to use

That’s when Brendan Eich created JavaScript in 1995 for Netscape 2 browser. He created JS in 10 days.

Is JavaScript related to Java?

They both are different. The name similarity was a marketing move during Java's popularity.

  • Java is compiled into bytecode, which runs on the Java Virtual Machine (JVM).
  • JavaScript is interpreted directly by the browser’s JavaScript engine (like V8 in Chrome).

Java is statically typed and used in backend systems, mobile apps, and large-scale software. JavaScript is dynamically typed and primarily used for building dynamic web applications.

What is ECMAScript? How ECMAScript is different from JavaScript?

JavaScript is the language we write. ECMAScript is the specification that defines how JavaScript should behave.

  • ECMAScript is created by ECMA International (European Computer Manufacturers Association. It's a non-profit organization that develops standards for information and communication systems)
  • JavaScript engines (like V8, SpiderMonkey) follow ECMAScript rules to ensure consistent behavior across browsers.

Think of ECMAScript as the rulebook. JavaScript is the game we play using those rules. So when browsers implement JavaScript, they follow the ECMAScript specification.

And what’s ISO’s role in all this?

ISO (International Organization for Standardization) ensures global consistency in technical standards.

  • ECMA submitted the ECMAScript standard to ISO.
  • ISO then adopted ECMAScript, giving it formal recognition worldwide.

This ensures that JavaScript behaves consistently across browsers and platforms around the globe.

Let's Practice together

Practice in the browser console! we can also use it like a calculator to perform simple additions, multiplications and to print some message on console.

  1. Open your browser (Chrome or Firefox)
  2. Press F12 or Ctrl + Shift + I (Inspect mode)
  3. Go to the Console tab
  4. To write multiple lines: Use Shift + Enter to go to a new line and Enter to run the full block. Example code :

console.log("Congrats on starting your JavaScript learning journey");
console.log("Happy Learning!!!");
console.log("Add 2 and 4 :", 2+4);        

Reference :

MDN Docs | Intro to JS

Your Turn

  • What confused you most when you started learning JavaScript?
  • Let’s discuss — I’d like to hear your story!

To view or add a comment, sign in

Others also viewed

Explore topics