必须加分号的两种情况 no_defined 2022-04-09 96 阅读1分钟 1. 立即执行函数要加 (function () { })(); (function () { })(); 2. 使用数组的时候 const arr = [1, 2, 3] const str = 'pink'; [1, 2, 3].map(function (item) { console.log(item) }) let a = 1 let b = 2 ;[b, a] = [a, b] console.log(a, b)