- 1

Why total 9

var x =1; var arr=[2,3,7]; arr[x]=arr[x+1]; alert(arr[0]+arr[1])

15th Jun 2017, 9:36 AM
Kristina Hakobyan
Kristina Hakobyan - avatar
2 Respuestas
+ 1
arr[1] = arr[1+1] so arr[1] which was 3 becomes arr[2] which is 7 arr[0] which is 2 plus arr[1] which is 7 equals 9
15th Jun 2017, 9:43 AM
Mario L.
Mario L. - avatar
0
thx so much I understand all
15th Jun 2017, 9:45 AM
Kristina Hakobyan
Kristina Hakobyan - avatar