22nd Apr 2017, 11:24 AM
Christopher Moran
4 Answers
+ 10
var arr = [1,4,6,4,2]; for (var i = 0; i < 3; i++) { arr[i] += arr[i+2]; } document.write(arr[0]); arr[0] = arr[0] + arr [2] that is mean : arr[0] = 1 + 6 because index is started from 0 so the second index is 6. that is why the result is 7.
22nd Apr 2017, 11:29 AM
Agus Mei
Agus Mei - avatar
+ 5
because everyone is tired of g6
23rd Apr 2017, 4:56 AM
DeleteThisAccount
+ 2
@Agus Mei good explanation.
22nd Apr 2017, 11:54 AM
Christopher Moran
22nd Apr 2017, 11:41 AM
Mayur Chaudhari
Mayur Chaudhari - avatar