Skip to content
Advertisement

How to enter new rows in a dataset by keeping same index

I am trying to enter into the following dataset:

JavaScript

the rows:

JavaScript

As you could see, the dataset created with the first chunk of code turns a with the first row marked with index 1.

enter image description here

To maintain it, I used the following code to add two further rows where the new rows are added as follows at the last one of the original dataset:

JavaScript

But the code does not work. If possible I would like to ask someone how to deal with this issue and try to fix it. Thanks

Advertisement

Answer

Try:

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement