Please enable JavaScript.
Coggle requires JavaScript to display documents.
JavaScript Basics (Data Types (Numbers, Strings, Boolean, NaN, null,…
JavaScript Basics
-
Operators
Assignment =, +=, -=. *=. /=, %=
-
-
-
-
Special: new, this, typeof
-
Variables
-
can begin with a letter, an underscore or a dollar sign
cannot begin with numbers, special signs or other characters
Array
var anotherArray = new Array("Cool Array", myArray, 1, 3.1415);
-
-
-
-
-
if...else
var x = 5;
if(x < 5) { //do something } else if (x == 5) { // do something else } else { // in case none of the conditions are met }
switch
var description; var coffee = "Kona"; switch(coffee) { case "Blue Mountain": description = "Sweet, good body"; break; case "Kona": description = "Robust, earthy, balanced"; case "Sumatran": description = "Deep, dark"; break; case "Starbucks": case "Dunkin Donuts": description = "With enough cream and sugar, almost anything is good."; break; default: description = "I don’t know about that coffee…"; }
-
-
-
-