Welcome, Guest. Please
Login
Home
Help
Search
Login
FAQ
Radified
Ghost.Classic
Ghost.New
Bootable CD
Blog
Radified Community Forums
›
Rad Community Non-Technical Discussion Boards
›
The Water Cooler
› Programming & Boolean stuff
(Moderators: Rad, Christer, NightOwl, Pleonasm, MrMagoo, El_Pescador)
‹
Previous Topic
|
Next Topic
›
Pages: 1
Programming & Boolean stuff (Read 5080 times)
Rad
Radministrator
Offline
Sufferin' succotash
Posts: 4090
Newport Beach, California
Back to top
Programming & Boolean stuff
Oct 3
rd
, 2011 at 1:52pm
are these two expressions synonymous in javascripit?
(x !== 1)
! (x == 1)
is there ever a time when i might prefer to use one over the other?
IP Logged
MrMagoo
Übermensch
Offline
Resident Linux Guru
Posts: 1026
Phoenix, AZ (USA)
Back to top
Re: Programming & Boolean stuff
Reply #1 -
Oct 4
th
, 2011 at 9:22pm
The first expression should read (x != 1). You have an extra = in the first one. The second one does require 2 =, as you correctly wrote.
In this case, they will give the same result. The first one is slightly preferable since it can be done in a single operation.
In the first one, you are asking "is x not equal to 1?" It is a single question.
Vs the second express, which says "is x = 1? ok, now give me the opposite of that."
IP Logged
NightOwl
Radministrator
Offline
"I tought I saw a puddy
tat..."
Posts: 5826
Olympia, WA--Puget Sound--USA
Back to top
Re: Programming & Boolean stuff
Reply #2 -
Mar 23
rd
, 2012 at 10:24am
Oh dear, MrMagoo has fallen prey to the forum glitch that lists him as an *Ex Member* on the forum homepage after a spammer has been *deleted*. When the spammer is deleted, the next member above in the spammed thread gets this *Ex Member* designation until a new post is made in that forum so the most recent activity is updated.
This posting should accomplish that *correction*!
____________________________________________________________________________________________
No question is stupid ... but, possibly the answers are
!
IP Logged
Pages: 1
‹
Previous Topic
|
Next Topic
›
« Home
‹ Board
Top of this page
Forum Jump »
Home
» 10 most recent Posts
» 10 most recent Topics
Rad Community Technical Discussion Boards (Computer Hardware + PC Software)
- Norton Ghost 15, 14, 12, 10, 9, + Norton Save + Restore (NS+R)
- Norton Ghost 2003, Ghost v8.x + Ghost Solution Suite (GSS) Discussion Board
- Cloning Programs (Except Norton Ghost)
- NightOwl's Bootable CD/DVD
- PC Hardware + Software (except Cloning programs)
Rad Community Non-Technical Discussion Boards
- The Water Cooler ««
- YaBB Forum Software + Rad Web Site
Radified Community Forums
» Powered by
YaBB 2.4
!
YaBB
© 2000-2009. All Rights Reserved.