for循环 es6

totalPrice: function() {
let result = 0
// 末尾都没有分号啥的 喵喵喵喵
for (let i = 0; i < this.books.length; i++) {
result += this.books[i].price
}
return result

                // for(let i in this.books){}   这是es6里面的语法
                // for(let book of this.books)   直接取出来是book
            }

for循环 es6

上一篇:Nginx编译安装方式


下一篇:HashMap源码解析