This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Paul Irish tweeted a while back a code snippet that puzzled him (and me).
> "omg"; var x = 4;
// "omg"
> eval( `"omg"; var x = 4;` );
// "omg"
We both expected that the "return value" of this lines will be undefined
. It turns out what we see after evaluating these lines in a JavaScript console are not return values but rather a statement completion values. If you want to dig deeper in this topic Matt Zeunert enlightened me with his article.
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Stefan Judis | Sciencx (2017-03-18T11:00:00+00:00) Completion values in JavaScript (#tilPost). Retrieved from https://www.scien.cx/2017/03/18/completion-values-in-javascript-tilpost/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.