JavaScript Values
2025-01-08
Literal
: Numbers - decimals optional : Strings - single or double quoted
Variable
: Name of storage locn where data is stored
Line: // Line Comment
Block: /* Anything between these */
let x = 3; // Number Data Type
let result = "PASS"; // String
let testPassed = true; //Boolan
let noDefault = null; // Null
let noDefault; // Undefined
let flagvar = Symbol("PASS"); // Symbol
LET foodPrice = BigInt("0f10111111"); // Bigint
let importantObj = {}; // Object
let importantObj new Object(); // Object
let colors = ["red", "yellow", "green"]; // Array Data Type
let book = { // Object Data Type
title: "JavaScript Programming",
ISBN: "978-3-16-148410-",
author: "John Doe",
price: 25.99
}
function functionName( arg1, arg2, arg3) {
// Logic
let x = 0;
console.log(x);
return x;
}
functionName(); //execute
see functions.
Â