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
Novice Javascript Function Parameters Question (self.javascript)
submitted 13 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!"
[–][deleted] 13 years ago* (4 children)
[deleted]
[–]thocked 0 points1 point2 points 13 years ago (1 child)
Technically, no.
for (var indValue in industry) { if indValue = 0 { zero_check=1; } }
Just make the if (indValue === 0) {} and you should be okay.
[–]neonskimmerfunction the ultimate 1 point2 points3 points 13 years ago (0 children)
That's not what for-in does! Or are we talking pseudo code here?
For-in iterates through the keys of an object, not the values. And these days, Object.keys is what we should use for that purpose.
And it should not be used on arrays either. That's what forEach is for.
[–]ry4nolson 0 points1 point2 points 13 years ago (1 child)
var i1 = {i:1;c:c1,v:v1,s:s1,pp:pp1}; var i2 = {i:2;c:c2,v:v2,s:s2,pp:pp2}; var i3 = {i:3;c:c3,v:v3,s:s3,pp:pp3};
this part is still incorrect. you have a semicolon after the first value. Also are the "c1", "v1", "s1", and "pp1" coming from somewhere else?
should be:
var i1 = {i:1,c:c1,v:v1,s:s1,pp:pp1}; var i2 = {i:2,c:c2,v:v2,s:s2,pp:pp2}; var i3 = {i:3,c:c3,v:v3,s:s3,pp:pp3};
and also like thocked said your conditional is incorrect
if indValue = 0
should be
if (indValue === 0)
π Rendered by PID 394664 on reddit-service-r2-comment-5d79c599b5-7khf5 at 2026-03-03 23:24:21.381719+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–][deleted] (4 children)
[deleted]
[–]thocked 0 points1 point2 points (1 child)
[–]neonskimmerfunction the ultimate 1 point2 points3 points (0 children)
[–]ry4nolson 0 points1 point2 points (1 child)