if((age >=14)&&(age <19)){// logical condition
status ="Eligible.";// executed if condition is true}else{// else block is optional
status ="Not eligible.";// executed if condition is false}
//get cheatsheet of other languages toohttps://github.com/LeCoupa/awesome-cheatsheets/blob/master/languages/javascript.jshttps://github.com/mbeaudru/modern-js-cheatsheet
/* Convenient interactive cheat sheet */'https://htmlcheatsheet.com/js/'/* PDF VERSION */'https://websitesetup.org/wp-content/uploads/2020/09/Javascript-Cheat-Sheet.pdf'
dogs.toString();// convert to string: results "Bulldog,Beagle,Labrador"
dogs.join(" * ");// join: "Bulldog * Beagle * Labrador"
dogs.pop();// remove last element
dogs.push("Chihuahua");// add new element to the end
dogs[dogs.length]="Chihuahua";// the same as push
dogs.shift();// remove first element
dogs.unshift("Chihuahua");// add new element to the beginningdelete dogs[0];// change element to undefined (not recommended)
dogs.splice(2,0,"Pug","Boxer");// add elements (where, how many to remove, element list)var animals = dogs.concat(cats,birds);// join two arrays (dogs followed by cats and birds)
dogs.slice(1,4);// elements from [1] to [4-1]
dogs.sort();// sort string alphabetically
dogs.reverse();// sort string in descending order
x.sort(function(a, b){return a - b});// numeric sort
x.sort(function(a, b){return b - a});// numeric descending sort
highest = x[0];// first item in sorted array is the lowest (or highest) value
x.sort(function(a, b){return0.5-Math.random()});// random order sort