Using Javascript logical OR operator as an default operator
The Javascript logical OR operator works like this … If the first operand is truthy (see what is truthy and falsy), it will return the first operand. Otherwise it will return the second...
read moreJavascript logical AND operator does not necessarily return boolean true false
If you came from other programming language, you might expect the Javascript boolean operator to return a boolean true or false. But this is not necessarily the case in Javascript. It will return...
read moreWhat are false and true in Javascript?
Falsy in Javascript In Javascript, these are considered falsy … boolean false ” – empty string 0 – number zero NaN – Not a Number undefined null When placed in...
read moreHow to delete array elements in Javascript
To delete array elements in Javascript, you can either use delete or splice. The difference is that use of delete leaves “holes” in the array … This removes the “c”...
read moreJavascript not sorting numeric arrays correctly
Javascript arrays have a sort method, but it does not sort numeric arrays as expected. For example, this code … sorts them as if they are string, rather than numeric as expected....
read moreWhat is “that” in Javascript?
You might have seen the use of “that” in Javascript. You may know that “this” points to the object invoker of the function. But what is “that”? Actually,...
read moreWhat is Javascript Max Number?
Javascript has Number.MAX_VALUE which represents the maximum number that Javascript could represent. This number is 1.7976931348623157e+308 which is what this program outputs… This is a very...
read moreChanging Order Of Operation May Give Wrong Results in Javascript
In math, the associative property for addition says that … (x + y) + z == x + ( y + z ) is a true statement. However, due to round-off errors, Javascript does not always obey this rule. Take...
read moreInfinity in Javascript
Javascript has a number type called “Infinity”. If you run “typeof” on Infinity, you get Number… Infinity can be compared to itself and it returns true. Infinity is...
read moreAll contents are opinions and are copyrighted and may contain display ads and ad links for which site may receive revenues from.
See Terms of Use and Privacy Policy.