javascript colon function code example
Example 1: colon in js
var Car = {model:"2015", color:"blue"}; //car object with model and color properties
Example 2: colon in js
document.getElementById("demo").innerHTML = age>18? "True" : "False";
Example 3: colon in js
switch (new Date().getDay()) {
case 6:
text = "Today is Saturday";
break;
case 0:
text = "Today is Sunday";
break;
default:
text = "Looking forward to the Weekend";
}