Please sign in to comment.
Add *leading* comma tests.
Really interesting -- turns out leading commas *in arrays* are valid JS too. > eval('').length 0 > eval('[,]').length 1 > eval('[,,]').length 2 > eval('[,,,]').length 3 > eval('[,,true]').length 3 It seems that commas are always considered trailing, and if they have no value preceding them, undefined is used for that value. After that, the standard rule of optional trailing commas applies.
- Loading branch information...
Showing with 6 additions and 0 deletions.