DEV Community

CodeWithDhanian
CodeWithDhanian

Posted on

Day 6 JavaScript Key Terminologies Every Beginner Must Know

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";
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ง 2. Function

A block of reusable code designed to perform a task.

function greet() {
  console.log("Hello!");
}
Enter fullscreen mode Exit fullscreen mode

๐ŸŒ 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:

  1. Memory Allocation
  2. 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;
Enter fullscreen mode Exit fullscreen mode

๐Ÿงต 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
Enter fullscreen mode Exit fullscreen mode

๐Ÿช 8. Callback

A function passed into another function as an argument to be executed later.

function runTask(callback) {
  callback("Task Complete");
}
runTask(console.log);
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ฎ 9. Promise

Represents a value that may be available now, later, or never.

const promise = new Promise((resolve, reject) => {
  resolve("Success!");
});
Enter fullscreen mode Exit fullscreen mode

๐Ÿ•“ 10. Async / Await

A cleaner way to work with Promises.

async function fetchData() {
  let result = await promise;
  console.log(result);
}
Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘ค 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();
Enter fullscreen mode Exit fullscreen mode

๐Ÿ” 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
Enter fullscreen mode Exit fullscreen mode

โœ… 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!
Enter fullscreen mode Exit fullscreen mode

Top comments (0)