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
  • 21,986
  • 13
  • 70
  • 74
Rahul Raut
  • 623
  • 6
  • 21
  • 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,213
  • 9
  • 37
  • 60