Welcome to Day 6 of your JavaScript learning journey!
If you're serious about mastering JavaScript, it's essential to understand the lingo โ the core concepts that keep popping up everywhere in JS tutorials and documentation.
This article is your cheatsheet of essential JavaScript terminologies explained with examples.
๐ง 1. Variable
A variable is a container used to store values in memory.
let name = "Dhanian";
๐ง 2. Function
A block of reusable code designed to perform a task.
function greet() {
console.log("Hello!");
}
๐ 3. Scope
Scope determines where a variable is accessible in your code.
- Global Scope
- Function Scope
- Block Scope (with let/const)
โ๏ธ 4. Execution Context
The environment in which code is executed. There are two main types:
- Global Execution Context
- Function Execution Context
Each context has two phases:
- Memory Allocation
- Code Execution
๐งฑ 5. Call Stack
A stack data structure that keeps track of function calls.
It works on LIFO (Last In, First Out) โ the last function pushed onto the stack is the first one to finish.
๐ผ 6. Hoisting
JS moves declarations (not initializations) to the top of their scope during the memory phase.
console.log(a); // undefined
var a = 10;
๐งต 7. Closure
A function that retains access to its lexical scope even when executed outside that scope.
function outer() {
let count = 0;
return function inner() {
count++;
console.log(count);
}
}
const counter = outer();
counter(); // 1
counter(); // 2
๐ช 8. Callback
A function passed into another function as an argument to be executed later.
function runTask(callback) {
callback("Task Complete");
}
runTask(console.log);
๐ฎ 9. Promise
Represents a value that may be available now, later, or never.
const promise = new Promise((resolve, reject) => {
resolve("Success!");
});
๐ 10. Async / Await
A cleaner way to work with Promises.
async function fetchData() {
let result = await promise;
console.log(result);
}
๐ค 11. This
Refers to the object that is currently executing the function.
const user = {
name: "Dhanian",
greet() {
console.log("Hi, I'm " + this.name);
}
};
user.greet();
๐ 12. Event Loop
The mechanism that handles asynchronous code in JavaScript. It works with:
- The Call Stack
- The Task Queue (Callback Queue)
๐ 13. Data Types
- Primitive: string, number, boolean, null, undefined, symbol, bigint
- Non-Primitive: object, array, function
โป๏ธ 14. Type Coercion
JavaScript converts values automatically during operations.
"5" + 1 // "51"
"5" - 1 // 4
โ 15. Truthy and Falsy Values
-
Falsy:
false,0,"",null,undefined,NaN - Everything else is Truthy
๐ Bonus: Get the Full JavaScript Ebook
Want to dive deeper with 200+ real-world practice projects, examples, and full explanations?
๐ Take this JavaScript Ebook
Itโs beginner-to-advanced, designed to help you build and master JS step by step.
โ Next up: Stay tuned for Day 7 โ JavaScript Data Types Cheatsheet
Follow me if you're loving this series โ letโs build together!
Let me know when you want **Day 7** done!
Top comments (0)