Cover image for How to generate an ID for Array sequentially ?!

How to generate an ID for Array sequentially ?!

mohsenfallahnjd profile image Mohsen Fallahnejad Updated on ・1 min read

All of us need to create objects or arrays to store different things at different times.
One of the important things in this section is to create a proper ID that will make the array more regular and easier to access to each component.
In different cases and depending on different conditions, the process of ID production may be different, But sequential ID generation is mostly used.

alt text

This statement creates the next target ID by taking the length of the array and obtaining ID of the last index.

This is the first post that I’m writing in "Dev.to" and I hope to continue :)
If you found it useful, you can follow me and also visit my website, because there are more ways to connect with me. I hope this would help you to improve your coding skills. Thank you for your attention.

This article was originally published on The Dev.to on March 15, 2020 and was written by Mohsen Fallahnejad.

Posted on Mar 15 by:

mohsenfallahnjd profile

Mohsen Fallahnejad


I like JavaScript codding in Front-end form and especially Vue.js


markdown guide