Basic algo
Thu Jul 07 2022 14:52:04 GMT+0000 (Coordinated Universal Time)
Saved by
@patdevwork
const lastLetterOfLastName = lastName[lastName.length-1];// assigns the last element of a string
switch (lowercaseLetter) { // switch format
case "a":
console.log("A");
break;
case "b":
console.log("B");
break;
}
const fruits = ["Banana", "Orange", "Apple", "Mango"]; // checks if an item is included in the array
fruits.includes("Banana", 3);
delete ourDog.bark; // delete an objects properties
myObj.hasOwnProperty("top");
myObj.hasOwnProperty("middle"); // check the object property if exist..returns true or false
Math.floor(Math.random() * 20); // create random no from 0-19
Math.floor(Math.random() * (max - min + 1)) + min // with max and min
content_copyCOPY
Comments