In JS, there is no negative numeric literal. `-500` might look like one, but it's actually +500 negated using the unary `-` operator.
The more you know 
-
-
Replying to @bterlson
In JS, there’s `if` and `else`, but there’s no special `else if` construct. It might look like there is, since `else if` works…
…but it’s just an `if` nested within an `else` block without braces.
else if (x) {}
→
else { if (x) {} }
The more you know
23 replies 155 retweets 591 likes -
Do other C-like languages (incl. Java and of course C) work the same way?
1 reply 0 retweets 1 like
Replying to @linuxgeek64 @bterlson
C does the same thing, based on http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4727.pdf …
8:04 PM - 31 Jan 2019
0 replies
0 retweets
7 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.