DEV Community

loading...

Discussion on: Array Indexing Method

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 Author

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.