var js
snippet in javascript

var js

user8269

var num = 1:

how to define variable in javascript

user5867

var <variable-name>;

var <variable-name> = <value>;

javascript var

user4077


 var text = "";
var i;
for (i = 0; i < 5; i++) {
  text += "The number is " + i + "<br>";
} 

js variables

user3722

// let & var are both editable variables:
var cow = 'moo';
let pig = 'oink';
cow = 10;
pig = 10;
// const is a permanent variable; you cannot change it.
const uncuttableGrass = '\/\/';
uncuttableGrass = '___';
// above throws an error

vars javascript

user341

var /*var*/ = /*What it does*/