Normally I use loops for incrementing/decrementing, looping through arrays, objects etc.
When doing Javascript Koans, one of the first problems stumped me.
var result = 0;
for (var i = 0; i <=5; i++) {
result += i;
}
console.log(result); //15
I am failing to understand why this outputs 15. From looking around I cannot seem to find another question on this specifically--or documentation to enable me to learn further. "+=" is not a valid search term in Google.
Source is here(1st/2nd question): https://github.com/liammclennan/JavaScript-Koans/blob/master/topics/about_operators.js
Thanks!