I was reading the 'learning Node' book and I was stuck in a very simple issue, one that I haven't given too much thought about: assignment in javascript.
The author states that we should realize that by using the Node's REPL, the following would return undefined:
var a = 2
(undefined)
while the code below will return '2' in the REPL:
a = 2
2
why is that? the code right above is not an attribution? how come? If the var 'a' hasn't existed until that point in the code, how come it is not and attribution?
See Question&Answers more detail:os