Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (5 sloc) 307 Bytes

Initializing Variables with the Equal Operator

In most cases you will see a variable being declared and given an initial value all at the same time. This allows you to use it right away with a proper value.

var myVar = 0;

Creates a new variable called myVar and assigns it an initial value of 0 .

Something went wrong with that request. Please try again.