CodeNFacts
CodeHub
Home

All Categories


Sign In
javascript-notes.md

CodeNFacts · Programming Language

JavaScript

The language that runs in every browser on Earth - and, thanks to Node.js, on the server too. This page is a complete, project-ready reference: full syllabus, cheat sheets, diagrams, and the theory behind why JS works the way it does.

21

Chapters

36

Topics Covered

3

Diagrams

About JavaScript

One language, every corner of software

Where it's used

Frontend UI, backend services with Node.js, mobile apps (React Native), desktop apps (Electron), game engines, browser extensions, automation scripts, and increasingly AI-assisted tooling. Almost no software category is untouched by JS.

Why it endures

It's the only language that ships natively in every browser, so the frontend is never optional. Add a fast JIT-compiled runtime, an enormous npm ecosystem, and a syntax that's approachable for beginners yet powerful enough for large systems.

Core features

Dynamic typing, prototype-based objects, first-class functions, closures, and an event-driven, non-blocking model built around the event loop — this combination is what makes async code (network calls, timers, UI events) feel natural.

Where it's headed

WebAssembly for performance-critical code running alongside JS, server components blurring frontend/backend lines, edge runtimes shrinking cold-start times, and AI-assisted coding tools making JS's already-low barrier to entry even lower.

The theory worth understanding early

JavaScript is single-threaded — only one thing runs at a time on the Call Stack. What makes it feel concurrent is the event loop: long-running work (timers, network requests) is handed off to the browser or Node's C++ APIs, and only the follow-up callback returns to the Call Stack later. Understanding this one idea explains hoisting quirks, why async/await reads top-to-bottom while still being non-blocking, and why a Promise callback always runs before a setTimeout callback, even at 0ms.

Full Syllabus

Every topic, in order

What JavaScript is, where it runs, and how it went from a 10-day prototype to the language of the web.

  • High-level, interpreted, object-oriented, event-driven language
  • Powers Frontend, Backend, Mobile, Desktop, Games, APIs, Automation, AI/ML
  • Runs in the browser (Chrome, Firefox, Edge) and on the server via Node.js
  • Created by Brendan Eich in 1995, built in just 10 days
  • Renamed twice — Mocha → LiveScript → JavaScript
console.log("Hello World");
// Output: Hello World

Quick Reference

Cheat sheets

Array Methods

push()add to end
pop()remove from end
map()transform every item
filter()keep matching items
reduce()fold into one value
find()first match
includes()true / false check
sort()reorder in place

String Methods

lengthcharacter count
toUpperCase()ALL CAPS
slice(a,b)extract substring
trim()remove edge spaces
includes()contains check
split()string → array
replace()swap text
startsWith()prefix check

Comparison & Logic

==loose equality (coerces)
===strict equality
&&AND
||OR
!NOT
?? nullish coalescing
?:ternary shorthand
!!xforce to boolean

Data Types

Number10, 3.14
String"text"
Booleantrue / false
Undefineddeclared, no value
Nullexplicitly empty
BigInt123n
Symbolunique id
Object/Arraynon-primitive

Visual Notes

Diagrams & sketches

The Event Loop

Call StackWeb APIssetTimeout, fetchCallback QueuemacrotasksMicrotask QueuePromisesEventLoop

Closures

outer() scopelet count = 0returned functionremembers count

Scope Chain

Global ScopeFunction ScopeBlock Scope let x = 5

Keep this reference offline

One click gets you every chapter, code example, and cheat sheet on this page in a single text file.