{… Many ways in JavaScript }

Dheeraj Kumar Rao
JavaScript Kingdom
Published in
2 min readJan 26, 2019

Right knowledge is the ultimate solution to all our problems. — Bhagavad Gita

Every Problem contains within itself the seed of its own solution. — Stanley Arnold

In this Post, we are going to learn, How to solve the same problem by multiple ways in JavaScript.

  1. IIFE(Immediately Invoked Function Expression)

An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.

Here we can write IIFE by 12 ways.

2. Creating Arrays

The JavaScript Array object is a global object that is used in the construction of arrays; which are high-level, list-like objects. For this topic I would like to say thanks to 2ality.com .

Here we can create array by 10 ways.

3. Function

Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure — a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.

Here we can write function by 6+ ways.

4. Covert to Number

The Number JavaScript object is a wrapper object allowing you to work with numerical values. A Number object is created using the Number() constructor. A primitive type object number created using the Number() function.

Here we can convert string to Number by 9 ways.

Thanks for Reading!

If you found any mistake please post in comments. I would like to hear your suggestions and comments. This is my first post.

My twitter handle :-

--

--