Mostly developers face many issues because of silly programming mistakes.
We check the variables for certain values, but there are two types of operators, we can use. I suggest using strict operators over type converting.
Type converting operator like == converts operands, if they are not of the same type. To demonstrate or test, you can try the following statements and see the output.
So, the mistakes of using == operator result in TRUE value for 1==”1”, which can be wrong in a real scenario. Therefore, it is always advisable to use type strict operators.
Strict operators like === don’t convert operands and returns true, if the operands are strictly equal.
Use function parseInt in such scenario to rescue you, otherwise you’ll spend time in debugging.
Float point numbers
Programming languages are not always correct to match the floating point numbers.
Floating numbers are saved in 64 bits. Hence, the right way to do is: