EDIT This question has been answered, but I've chosen to clarify it for future readers.
I've studied the explanations given about the logical operator !(parameter)
and the inequality operator !==
. They do not though clarify in what way they differ from each other. Let's look at an example.
!($.inArray(latlng, markers) == -1)
and
$.inArray(latlng, markers) !== -1
What is the difference between theese two expressions and are there any performance issues with either of the solutions making the other more preferable?
There really isn't a whole lot of difference, just the order that the logic operates. The first statement checks if they are equal and then gives you the opposite result. The second checks to see if they are different by comparing the values to see if they are the same and returning false if they are.
In effect, they are the same. There is actually something called DeMorgan's Law that governs the equality between comparison and logical operators (i.e. stating that they are equivalent and can be exchanged for others that have the same result in a different structure)