Author Archives: super-admin

JavaScript Hotline

This is a FREE helpline run by volunteers and supported by the community. The folks on the other end of the phone are fellow JavaScript developers donating a little time for the good of our community and the web as a whole.

https://javascript.pockethotline.com/

How to sort two dimensional associative array in javascript ?

 

How to create two dimensional associative array in javascript ?

 

How to create two dimensional array in JavaScript?

3 ways to define a JavaScript class

JavaScript is a very flexible object-oriented language when it comes to syntax. In this article you can find three ways of defining and instantiating an object. Even if you have already picked your favorite way of doing it, it helps to know some alternatives in order to read other people’s code.

It’s important to note that there are no classes in JavaScript. Functions can be used to somewhat simulate classes, but in general JavaScript is a class-less language. Everything is an object. And when it comes to inheritance, objects inherit from objects, not classes from classes as in the “class”-ical languages.

1. Using a function

2. Using object literals

3. Singleton using a function

Click to know more

 

What is the difference between == and === in JavaScript ?

==  is normal equality check , or we can say type-converting equality check.

Here if we check

Here 0 & false, 1 & "1" are of different type , but == operator will compare for equality after doing any necessary type conversions.

 

=== is strict equality check,  here it means that two values must have same type to check equality

Here if we check

The === operator will not do the conversion, so if two values are not the same type, === will simply return false.

How to pass variable (Multiple) number of arguments to function ?

Look at the following function, which accept any number of parameters.