JavaScript is a lightweight, interpreted programming language that is designed for creating network-centric applications.
console.log("Hello Devendra Dora");
alert("Hello Devendra Dora");
var are function-scoped or globally scoped.let are block-scoped.const cannot be reassigned.var firstName = "Devendra"; // function-scoped or globally scoped
let lastName = "Dor"; // are block-scoped
firstName ="Devendra Kumar"
lastName = "Dora"
console.log("Hello "+firstName+" "+lastName) // concatenate strings with +
const PI = 3.14; // cannot be reassigned
// Attempting to reassign a const variable will result in an error
// PI = 3.14159; // TypeError: Assignment to constant variable.
console.log(PI);
JavaScript has data types: Number, String, Boolean, Undefined, Null, Object
Primitive Data Types:
let num = 10;
let floatNum = 3.14;
bigintlet name = "Devendra Dora";
let message = 'Hello MentorX';
true or false.let isStudent = true;
let hasLicense = false;
let x;
console.log(x); // Output: undefined
let y = null;
console.log(y);
const sym1 = Symbol();
const sym2 = Symbol('description');