• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript code question

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am unable to understand myArray[4] and line no 8 from the below code. Can someone explain me what it means?



Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this is just academic code and not something that's actually being used for anything!

In any case, [4] is a regular expression, which possesses a test() method which is being called.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it on this page actually.
http://www.hunlock.com/blogs/Mastering_Javascript_Arrays
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not consider it any sort of valid programming style!

Eeeesh!
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic