0

I read in the doc

An expression is any valid unit of code that resolves to a value.

Is the aforementioned value what is returned in the console next to < ?

enter image description here

Also how come x = 7 resolves to the value 7, and var x = 7 resolves to the value undefined since the two commands are doing the same thing : assigning the value 7 to the variable x of the global namespace ?

j08691
  • 204,283
  • 31
  • 260
  • 272
Lev
  • 13,856
  • 14
  • 52
  • 84
  • 2
    `var x = 7` is a statement, not an expression. – JJJ Nov 01 '16 at 13:40
  • if you assign a variable, you have no output. Thus, the output is undefined. – Tom M Nov 01 '16 at 13:40
  • 1
    Having `var` statements return anything is meaningless, as you can't use the `var` keyword anywhere where you would be able to use the returned value. Regular assignment does however always return the value. – adeneo Nov 01 '16 at 13:41

0 Answers0