• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

5.1. Expressions

An expression is a phrase of JavaScript that a JavaScript interpreter can evaluate to produce a value. The simplest expressions are literals or variable names, like these:

1.7                       // A numeric literal
"JavaScript is fun!"      // A string literal
true                      // A boolean literal
null                      // The literal null value
/java/                    // A regular expression literal
{ x:2, y:2 }              // An object literal
[2,3,5,7,11,13,17,19]     // An array literal
function(x){return x*x;}  // A function literal
i                         // The variable i
sum                       // The variable sum 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint