Skip to main content

Posts

Boolean Data Type

// CLASS TOPICS : BOOLEAN DATA TYPE // true or false // a = 10 // b = 20 // console.log(a != b); // not equal to -> same in javscript is != // equal to => == // we can check logic it will be either true or false // CHAINING LOGIN // console.log(1 > 0 < 5 < 6); // chaining expressions to get logical value either true or false // CHECK IF BOTH ARE TRUE // isBreadAvailable = true // isEggAvailable = false // console.log(isBreadAvailable && isEggAvailable) // so here we are checking if both value are true using && // check if any one of them is true // console.log(1 > 5 || 2 > 5) // using || means you are checking if any of the given condition is true or not // mixup of and ,or // console.log( (1 < 5 && 2 > 5) || 1 > 0)

Data types

Examples of Datatypes: // CLASS TOPICS : VARIABLE , CONSOLE , NUMBER DATA TYPE a = -10 heap memory -> a variable will be stored in heap memory and this a variable will refer to a value 10 console.log(a); console is used to print values in your terminal window and in your browser console b = 1.1 floating number b typeof(a) it is used to check type of a variable // OPERATIONS console.log(10 + 2 - 2) console.log(3 % 10); % -> means modulus and modulus give you reminder // BODMAS a = (1 + 2) * (3 + 5) console.log(a);