O'Reilly logo

JavaScript Recipes: A Problem-Solution Approach by Keith Cirkel, Russ Ferguson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Russ Ferguson and Keith Cirkel 2017
Russ Ferguson and Keith CirkelJavaScript Recipes10.1007/978-1-4302-6107-0_1

1. Working with JavaScript Datatypes

Russ Ferguson and Keith Cirkel2
(1)
Ocean, New Jersey, USA
(2)
London, UK
 
Electronic supplementary material
The online version of this chapter (doi:10.​1007/​978-1-4302-6107-0_​1) contains supplementary material, which is available to authorized users.

Assigning Variables with the var Statement

Problem

When programming (just like in algebra), you need to be able to assign a variable piece of data to a keyword that you can reference in your code, for example x = 5.

Solution

With JavaScript, variable assignment needs to be declared using a keyword, which helps to determine the behavior of a variable. The most ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required