Variables and Data Types

let name = "Ali";      // String
let age = 20;          // Number
let isStudent = true;  // Boolean

console.log(name, age, isStudent);

Explanation:

  • let and const are used for declaring variables.
  • JavaScript automatically detects data types (string, number, boolean, etc.).

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *