DEV Community

Cover image for Array Indexing Method

Array Indexing Method

Shubham Battoo on February 07, 2021

Recently, came across a cool Twitter thread which talks about a new way to access the array items. Basically, this is a tc39 proposal which is at ...
Collapse
 
learnwithdrona profile image
Drona

This is good Shubham. Why JS cannot support Pythonic approach to have negative numbers within indexing square brackets.

Collapse
 
shubhambattoo profile image
Shubham Battoo

Thats already there, if you do something like.

arr[-1] ; // undefined
Enter fullscreen mode Exit fullscreen mode

That is why they are not going with that approach.