What is JavaScript?
Why JavaScript exists, what it powers, and how to run your first line of code.
You click a button. The page updates instantly — no reload. You type in a search box and suggestions appear. You drag a file and it uploads. None of that is HTML or CSS.
That's JavaScript.
Created in 10 days in 1995 by Brendan Eich at Netscape, JavaScript was originally just a way to validate form inputs without a server round-trip. Three decades later it powers Google Docs, Figma, Discord, and VS Code — the editor you might be using right now is a JavaScript app.
Here's your first JavaScript program:
console.log("Hello, World!");console.log() is your best friend while learning. It prints (displays) any value in the console — a special panel where programmers can see messages from their code. Think of it as your program's way of talking to you.
Every piece has a job:
console— the built-in tool that represents that message panel.log()— the action that does the printing. An action a tool knows how to perform is called a method — you'll meet many more methods soon"Hello, World!"— the text to print. Text wrapped in quotes is called a string (a string of characters);— the semicolon marks the end of an instruction, like a full stop ends a sentence
What gets printed to the console?
console.log("JavaScript");
console.log("is");
console.log("fun");- AJavaScript is fun
- BJavaScript is fun
- C"JavaScript" "is" "fun"
- DError
JavaScript doesn't only run in browsers. Node.js brought JavaScript to servers in 2009 — the same language now powers backend APIs, CLIs, and build tools.
This means one language can do everything:
- Frontend — React, Vue, Vanilla JS in the browser
- Backend — Express, Fastify APIs in Node.js
- Mobile — React Native apps
- Desktop — Electron apps (VS Code, Slack, Discord)
- Serverless — AWS Lambda, Cloudflare Workers
Learning JavaScript once opens all of those doors.
A developer wants to build a web app with a React frontend AND a Node.js API backend. How many programming languages do they need to learn for both?
- ATwo — JavaScript for the frontend and Node.js for the backend
- BOne — JavaScript runs on both the frontend and backend
- CTwo — React is a different language from JavaScript
- DThree — frontend, backend, and a database language
JavaScript runs wherever there is a JavaScript engine — a program that reads JS code and executes it.
Browsers have engines built in:
- V8 — Chrome, Edge, Node.js, Deno
- SpiderMonkey — Firefox
- JavaScriptCore — Safari
Think of the engine as a chef. Your JavaScript code is the recipe. The engine reads each instruction and carries it out, line by line, top to bottom — unless you tell it to branch or loop.
Complete the code to print the text LingoCode to the console:
___.log("LingoCode");Quotes mean text. What does this print?
console.log(2 + 2);
console.log("2 + 2");- A4 4
- B4 2 + 2
- C2 + 2 2 + 2
- D"4" "2 + 2"
- JavaScript is the programming language of the web — it makes pages interactive, and (thanks to Node.js) also runs servers, mobile apps, and desktop apps
- A JavaScript engine (like V8 in Chrome) reads your code and carries it out line by line, top to bottom
console.log()prints values to the console — your window into what a program is doing- Text in quotes is a string; numbers without quotes are calculated
- A method is an action something knows how to do, called with a dot:
console.log(...)
Next up: where to actually type and run JavaScript yourself.