03 2021 档案
摘要:数组扁平化 const arr = [1, 2, 3, [4, [5, 6, [7,8]]]]; console.log(arr.flat(Infinity)); // [1, 2, 3, 4, 5, 6, 7, 8] console.log(arr.join().split(',')); // [
阅读全文
摘要:document.getElementById('copy').onclick = function () { let input = document.createElement('input'); input.setAttribute('id','input'); input.value = '
阅读全文
摘要:1、含有多个条件的if语句 我们可以在数组中存储多个值,并且可以使用数组的 includes 方法。 //longhand if (x 'abc' || x 'def' || x 'ghi' || x 'jkl') { //logic } //shorthand if (['abc', 'def',
阅读全文
摘要:示例1:新旧节点不同 <template> <div id="app"> <hello-world :flag="flag" /> <button @click="toggle">toggle</button> </div> </template> <script> import HelloWorl
阅读全文
浙公网安备 33010602011771号