1

I was trying something in the browser console and I encountered the following scenario. What is happening under the hood here?

'hello'[4] === 'hello'[1,2,3,4] === true;
aminography
  • 20,387
  • 13
  • 62
  • 71
Rahul Raut
  • 601
  • 6
  • 19
  • 1
    `'hello'[4]` gives `o` as does `'hello'[1,2,3,4]`. Why `'hello'[1,2,3,4]` returns 'o' though is probably your real question – phuzi Nov 06 '19 at 11:07

1 Answers1

-2

Because both 'hello'[4] and 'hello'[1,2,3,4] returns o

Michael 'Maik' Ardan
  • 4,043
  • 9
  • 35
  • 57