Node.js Succinctly: Arrays

Node.js Succinctly: Arrays

Node.js provides an Array object for collection manipulation. In general, a Node.js Array object
has the same behavior as a JavaScript Array object. In this section, we are going to
manipulate an Array object in Node.js 

Creating an Array Object

There are three ways to create an Array object. The first is simply by typing the array object.

Option two is to create an Array object by instantiating the Array object. 

The last option is to create an Array object by inserting collection data. 

Inserting Data

After creating an Array object, we can insert data. Use [] with the index if you want to assign the
value. 

You can also use the push() function to insert data. 

Accessing Data

To access array data, you can use [] with the data index parameter. 

Showing array data

Updating Data

To update an item of array data, you can use [] with the data index and thus assign a new value. 

Removing Data

You can use the pop() function to remove data from the Array. If you want to remove data by
specific index then you can use the splice() function.

The following is a sample script for removing data: 

This tutorial represents a chapter from Node.js Succinctly, a free eBook from the team at Syncfusion.

Source: Tuts Plus

About the Author

Comments

  1. … [Trackback]

    […] Read More: designncode.in/node-js-succinctly-arrays/ […]

  2. … [Trackback]

    […] Read More here: designncode.in/node-js-succinctly-arrays/ […]

  3. … [Trackback]

    […] Informations on that Topic: designncode.in/node-js-succinctly-arrays/ […]

  4. … [Trackback]

    […] Informations on that Topic: designncode.in/node-js-succinctly-arrays/ […]

  5. … [Trackback]

    […] Find More Informations here: designncode.in/node-js-succinctly-arrays/ […]

  6. … [Trackback]

    […] Read More Infos here: designncode.in/node-js-succinctly-arrays/ […]

  7. … [Trackback]

    […] Informations on that Topic: designncode.in/node-js-succinctly-arrays/ […]

  8. … [Trackback]

    […] Read More Infos here: designncode.in/node-js-succinctly-arrays/ […]

  9. … [Trackback]

    […] Read More: designncode.in/node-js-succinctly-arrays/ […]

  10. … [Trackback]

    […] Read More here: designncode.in/node-js-succinctly-arrays/ […]

  11. … [Trackback]

    […] Find More Informations here: designncode.in/node-js-succinctly-arrays/ […]

  12. … [Trackback]

    […] Informations on that Topic: designncode.in/node-js-succinctly-arrays/ […]

  13. … [Trackback]

    […] Read More: designncode.in/node-js-succinctly-arrays/ […]

  14. … [Trackback]

    […] Read More here: designncode.in/node-js-succinctly-arrays/ […]

  15. … [Trackback]

    […] Find More Informations here: designncode.in/node-js-succinctly-arrays/ […]

  16. … [Trackback]

    […] There you will find 83976 more Infos: designncode.in/node-js-succinctly-arrays/ […]

  17. … [Trackback]

    […] Read More here: designncode.in/node-js-succinctly-arrays/ […]

  18. … [Trackback]

    […] There you will find 92593 more Infos: designncode.in/node-js-succinctly-arrays/ […]

  19. … [Trackback]

    […] Find More Informations here: designncode.in/node-js-succinctly-arrays/ […]

  20. … [Trackback]

    […] Read More here: designncode.in/node-js-succinctly-arrays/ […]

  21. … [Trackback]

    […] There you will find 92581 more Infos: designncode.in/node-js-succinctly-arrays/ […]

  22. … [Trackback]

    […] Read More here: designncode.in/node-js-succinctly-arrays/ […]

  23. … [Trackback]

    […] Read More: designncode.in/node-js-succinctly-arrays/ […]