i tried with 2 versions of nodejs the one that shipped with 16.04 and 8
var x = [1, 2, 3, 4, 5]; var sum = x[0]; for (var i=0; i <x.length; i++){ sum += i; } console.log(sum/x.length); 2.2 [Finished in 0.068s]
No comments:
Post a Comment