- 1
16th Jun 2017, 9:05 AM
Kristina Hakobyan
2 Answers
+ 2
x.length % 2 = 1
x[1] = 2
x[2] = 3
16th Jun 2017, 9:20 AM
Jakub Stasiak
- 1
thx
16th Jun 2017, 9:20 AM
Kristina Hakobyan
Often have questions like this?
Learn more efficiently, for free:
var x=[1,2,3]; alert(x[x[x.length%2]])