0

Can some one help me clear this doubts in JavaScript

var sum = 0; for(i=1; i<=9; i++){ if(i%5===0lli%3==0{ sum+=i; } } output 23 why I don't just get this stuff is there any link you know where I can go and improve my js Algorithms skill , this really killing me in JS ,please help

11th Aug 2018, 9:00 AM
George S Mulbah II
George S Mulbah II - avatar
3 ответов
+ 4
For loop will run untill i is 10. Now when i will be 3 , 5 , 6 , 9 at that time only it will be added to sum variable because of if. Hence 3 + 5 +6 +9 =23.
11th Aug 2018, 9:08 AM
Meet Mehta
Meet Mehta - avatar
+ 2
George S Mulbah I doesn't have any such kind of reference.
11th Aug 2018, 9:32 AM
Meet Mehta
Meet Mehta - avatar
0
Meet Mehta can you give me where I can improve my Algorithms skill in js
11th Aug 2018, 9:12 AM
George S Mulbah II
George S Mulbah II - avatar