Results 5 comments of 咸菜

```js // 闭包 for (var i = 0; i < 10; i++) { (function (i){ setTimeout(() => { console.log(i); }, 1000); })(i); } // 块作用域 for (let i = 0;...

```js const splitSource = (source) => { let targetArray = [[],[],[]]; source.split('').forEach(element => { switch (element) { case '黄': targetArray[0].push(element) break; case '红': targetArray[1].push(element) break; case '蓝': targetArray[2].push(element) break; default:...

```js const Curry = fn => { return function judge (...firstParma){ if (firstParma.length >= fn.length) { return fn(...firstParma); } else { // 这里的 ...secondParma 函数的第二次或者更多次调用时的参数, ...firstParma 是第一次传入的参数,这里的意思是 // 当函数只有一个的时候就直接返回一个 rest...

```js const getDateValueOf = (day) => new Date(day).valueOf() const setLocalStringDate = (value) => new Date(value).toLocaleDateString().replace(/\//g,'-') const getDate = (startDay, endDay) => { const standardDayValue = 86400 * 1000; if (getDateValueOf(startDay)...

the webgpu wgsl language syntax has changed to many. you try to run the webgpu54,its will be worked