Tutorials on Web Development, Programming, and Web Design

Using Javascript logical OR operator as an default operator

In Tutorials

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 more

Javascript logical AND operator does not necessarily return boolean true false

In Tutorials

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 more

What are false and true in Javascript?

In Articles

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 more

How to delete array elements in Javascript

In Tutorials

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 more

Javascript not sorting numeric arrays correctly

In Tutorials

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 more

What is “that” in Javascript?

In Articles

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 more

What is Javascript Max Number?

In Articles

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 more

Changing Order Of Operation May Give Wrong Results in Javascript

In Articles

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 more

Infinity in Javascript

In Articles

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 more

Learn Web Tutorials is hosted by Hostmonster and design based on Wordpress template by Elegant Themes
All 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.