Stranger Things, JavaScript Edition
11–20 of 58 posts
Re: Stranger Things, JavaScript Edition
#12 '9' + 1
= "91"
+'9' + 1
= 10
It's all very weird though...Re: Stranger Things, JavaScript Edition
#13Common confusion has to do with how JS overloads the "+" operator. '9' + 1 = "91" +'9' + 1 = 10 It's all very weird though...
Re: Stranger Things, JavaScript Edition
#14Re: Stranger Things, JavaScript Edition
#15Any engineer that allows any of the code like this in their codebase has only themselves to blame.
Re: Stranger Things, JavaScript Edition
#16For what you would expect the output to be:
[1, 7, 11]
However, things get a bit off here, and the actual result is:
[1,NaN,3]
At first, this may look up very weird, but it actually has an elegant explanation. "
The elegant explanation is that JavaScript was taken over by psychopaths like bajcmartinez.
JavaScript is fine for button onClick code. Outside of that it's garbage.
Re: Stranger Things, JavaScript Edition
#17None of those are mysteries and have been demonstrated years and years ago... So posting clickbait... Any engineer that allows any of the code like this in their codebase has only themselves to blame.
Re: Stranger Things, JavaScript Edition
#18Re: Stranger Things, JavaScript Edition
#19Re: Stranger Things, JavaScript Edition
#20Common confusion has to do with how JS overloads the "+" operator. '9' + 1 = "91" +'9' + 1 = 10 It's all very weird though...