This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* EXAMPLE ONE */ | |
const age = 21; | |
let increament = 1; | |
const result = age > 0 || inceament++ | |
console.log(result); // true | |
console.log(increament); // 1 | |
/* EXAMPLE TWO */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. init code | |
export function setup() { | |
// 2. setup code | |
} | |
export default function (data) { | |
// 3. VU code | |
} | |
export function teardown(data) { | |
// 4. teardown code | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const variable = "value"; | |
if(variable){ | |
let newVariable = "New Value"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a; | |
let total = 1 + 2; | |
let string = "value" + "value"; | |
let multiply = 1 * 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let firstName = "Bennison" | |
let lastName = undefined | |
if(lastName){ | |
console.log(`Hello ${firstName} ${lastName}`); | |
} | |
else{ | |
console.log(`Hello ${firstName}`); // Bennison |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(Boolean(undefined)) // false | |
console.log(Boolean(null)) // false | |
console.log(Boolean(NaN)) // false | |
console.log(Boolean(0)) // false | |
console.log(Boolean("")) // false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var variable = "value" | |
console.log(variable) // value | |
variable = "New Value" | |
console.log(variable) // New Value | |
var variable = "string" | |
console.log(variable) // string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const variable = "value" | |
console.log(variable); //value | |
variable = "new value"; // This line will give an error "Uncaught TypeError: Assignment to constant variable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let variable = "value"; | |
console.log(variable) // value | |
let variable = "value"; // value |
NewerOlder