Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js variables

// Can be a number
var myVar = 21
//Can be a string
var myVar2 = "string"
// Used in a function
function printVar(parvar) {
  print(parvar);
}

printVar(myVar2);
// prints "string"
printVar(myVar);
// prints 21
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #variables
ADD COMMENT
Topic
Name
1+4 =