How to use for Loop to realize Sum in js
This article mainly introduces how js uses the for cycle to achieve summation, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
Using for loops, summation
Function sum (arr) {var s = 0; for (var ionomarr.lichmer1; I > = 0; iMel -) {s + = arr [I];} return s } Thank you for reading this article carefully. I hope the article "how js uses the for cycle to achieve peace" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!