/    Sign up×
Community /Pin to ProfileBookmark

simple syntax question

Hey,

Is there a way to write the following more simply???:

[CODE]
if (one==0 && two==0 && three==0 && four==0 && five==0){…
[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@voidvectorJan 20.2009 — I don't see this as better, but it is more concise.
<i>
</i>if (one==two==three==four==five==0){...
Copy linkTweet thisAlerts:
@toicontienJan 20.2009 — A zero value resolves to a false boolean value, so...
[CODE]if (!one && !two && !three && !four && !five)[/CODE]
is the same.
×

Success!

Help @javascriptlover spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...