Skip to content

Instantly share code, notes, and snippets.

View BennisonDevadoss's full-sized avatar
🎯
Focusing

Bennison_J BennisonDevadoss

🎯
Focusing
View GitHub Profile
/* EXAMPLE ONE */
const age = 21;
let increament = 1;
const result = age > 0 || inceament++
console.log(result); // true
console.log(increament); // 1
/* EXAMPLE TWO */
let a = 10;
let b = 20;
let result = a > 0 && b > 10
console.log( result ) // true
// a > 0 is operand one -------> The condition is true
// b > 10 is operand two -------> The condition is true
// Here, The both conditions are same, So th AND Operator returns the true.
// 1. init code
export function setup() {
// 2. setup code
}
export default function (data) {
// 3. VU code
}
export function teardown(data) {
// 4. teardown code
}
const variable = "value";
if(variable){
let newVariable = "New Value";
}
let a;
let total = 1 + 2;
let string = "value" + "value";
let multiply = 1 * 1
let firstName = "Bennison"
let lastName = undefined
if(lastName){
console.log(`Hello ${firstName} ${lastName}`);
}
else{
console.log(`Hello ${firstName}`); // Bennison
console.log(Boolean(undefined)) // false
console.log(Boolean(null)) // false
console.log(Boolean(NaN)) // false
console.log(Boolean(0)) // false
console.log(Boolean("")) // false
var variable = "value"
console.log(variable) // value
variable = "New Value"
console.log(variable) // New Value
var variable = "string"
console.log(variable) // string
const variable = "value"
console.log(variable); //value
variable = "new value"; // This line will give an error "Uncaught TypeError: Assignment to constant variable"
let variable = "value";
console.log(variable) // value
let variable = "value"; // value