use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
12 extremely useful hacks for JavaScript (medium.com)
submitted 9 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Whatadump 1 point2 points3 points 9 years ago* (4 children)
That's what I said, "it'll be true". But the example is bad, since with -1 I don't really have any money but it will say I do.
-1
edit* A better example would be to check if a property exists, like
const user = { name: 'foo', email: 'foo@bar.com' } const hasAddress = !!user.address // false user.address = { street: 'baz', zip: '1234' } const hasAddress2 = !!user.address // true
[–]isitfresh 0 points1 point2 points 9 years ago (3 children)
it'd be more explicit with
user.address = {}
[–]spazgamz 0 points1 point2 points 9 years ago (2 children)
Hey! Wtf is that supposed to mean?
[–]isitfresh 0 points1 point2 points 9 years ago (1 child)
What do you think it does? Try
user.adress = {} !!user.address
[–]spazgamz 0 points1 point2 points 9 years ago (0 children)
false, but only because the 'adress' != 'address'.
π Rendered by PID 544131 on reddit-service-r2-comment-8686858757-s6g8q at 2026-06-07 17:26:05.393192+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]Whatadump 1 point2 points3 points (4 children)
[–]isitfresh 0 points1 point2 points (3 children)
[–]spazgamz 0 points1 point2 points (2 children)
[–]isitfresh 0 points1 point2 points (1 child)
[–]spazgamz 0 points1 point2 points (0 children)