Skip to main content

Posts

Showing posts from March, 2012

The Deference between == and === in javascript boolean and bool in c#

Brief, I have been keeping a list of things i wonder about about operators and things we usually use while coding and in the end, we dont know exactly there usage. For one is == and === in Javascript what is the deference? Answer === operator is type concerned operator so if it is used the two parties of comparison should be the same as each in matter of value and type for booleans they have to be same value false or true and they have to be booleans for strings same characters length positions and same type for instance 1===1 true 1 === "1" false cause they are not the same type * in order for the condition to be true the two parties must refer to the same object == operator has nothing to do with the type if the value is the same, it checks only for the value and never minds the type * in order for the condition to be true the two parties must be of the same value C# boolean and bool the answer is shocking there is not deference bool is an alias to system.b