Beginning AngularJS

(WallPaper) #1
ChApter 1 ■ JAvASCrIpt You Need to KNow

Listing 1-10. Declaring Multiple Variables at Once


<!DOCTYPE html>




JavaScript Primer





In the preceding listing, we use the var keyword to declare a new variable and then immediately assign it a value
of "red". The output below is then, perhaps, unsurprising.


The color is red


Listing 1-11 provides another example. This time we declare three variables at once and then assign values to
each of them afterward.


Listing 1-11. Declaring Multiple Variables at Once


<!DOCTYPE html>




JavaScript Primer




Free download pdf