JavaScript Basics Cheatsheet

๐Ÿ“ฆ Variables

Variables store data. Think of them as labeled jars. Use let, const, and var to declare.

let name = "Naveen";
const age = 25;
var mood = "excited";
    

Fun Fact: const means you can't reassign the value later.

๐Ÿงฎ Operators

Operators are symbols that perform operations on values:

let sum = 10 + 5;       // 15
let isAdult = age >= 18; // true
let canVote = isCitizen && isAdult;
    

๐Ÿ“ Data Types

JavaScript has dynamic types:

let score = 99;
let passed = true;
let student = { name: "Naveen", age: 20 };
let hobbies = ["coding", "gaming"];
    

๐Ÿงฐ Arrays & Objects

Arrays store lists. Objects store key-value pairs.

const fruits = ["apple", "banana", "mango"];
console.log(fruits[1]); // banana

const user = {
  username: "naveen",
  points: 120,
};
console.log(user.username);
    
๐Ÿ“š What's Next?
In the next post, you'll explore the magical world of the Conditional how to make your code respond to different situations. You'll learn how to handle multiple conditions and make your code even smarter.
Let's Go   →

โ€œThis is an educational resource about JavaScript created with original content. No user data is collected.โ€