12 2021 档案
摘要:含义 扩展运算符(spread)是三个点(...)。它好比 rest 参数的逆运算,将一个数组转为用逗号分隔的参数序列。 console.log(...[1, 2, 3]) // 1 2 3 console.log(1, ...[2, 3, 4], 5) // 1 2 3 4 5 [...docum
阅读全文
摘要:for循环的三种用法 1、第一种是我们平常用的最多的for循坏 如: 普通的for循环 ,显得繁琐,i为for为数组赋予的序号 let totalPrice = 0 for (let i = 0; i < this.books.length; i++) { totalPrice += this.bo
阅读全文