When Index of 'Array.map' Should Not Be Key

·

1 min read

When?

There are two conditions.

  1. 'input' is used.

  2. The new one is attached before the other ones.

Example

Code and Environment

How to Do

  1. Write what you want in 'id: 1 | index: 1' of both parts.

  2. Click the 'add' button.

Result

|'key' is 'index'|

What you wrote before follows 'index'. So, it is in 'id: 2 | index: 1'

|'key' is 'id'|

What you wrote before follows 'id'. So, it is in 'id: 1 | index: 2'