Home » Javascript3 July 2018

Javascript: Object & Loop

This article deals with creating a Javascript object and using different functions on the object. We also see how we can loop through the object and get the values.

Create a new Javascript Object

Access elements of the array

Another way of creating/defining object

Get keys of the object

Get values of the object

Get length/size of the object

Change value of any particular key

Add item/property to the object

Remove item/property from the object

Concatenate or merge multiple objects

Delete the newly added property

Check if the variable is an object

Using for…in loop

Using Object.keys() method to loop through the object

Using Object.values() method to loop through the object

Using Object.entries() method to loop through the object

Another way of write the above code

Using for loop with Object.entries() method

Nested object or Multi-dimensional object

Nested loop for-each

Nested loop for-each using recursive function

Nested loop for-each using recursive function

Here, we use the Arrow function, also called “fat-arrow” function.

It’s a more concise syntax for writing function expressions.

It was introduced in ECMAScript 6 (ES6).

ECMAScript (ES) is a scripting language specification standardized by ECMAScript International.

Hope this helps. Thanks.

Javascript

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed

Comments are closed.