
TypeScript
杏黄的三叶草
对于爱情,只字不提
展开
-
JavaScript的扩展运算符[...详解7种使用方法]
扩展运算符的使用途径 1、在解构赋值中使用 let [a,b]=[1,2] console.log(a,b) // a=1 b=2 let [c,d]=[1,2,3,4] console.log(c,d) // 按需解构c=1 d=2 let [e,...f]=[1,2,3,4,5,6] console.log(e,f) //e=1 f=[ 2, 3, 4, 5, 6 ] 2、用作剩余形参,就不必使用函数内置的argument伪数组 function getMax(...item: number[])原创 2022-01-16 18:50:31 · 919 阅读 · 0 评论 -
Cannot find name ‘console‘. Do you need to change your target library?ging the ‘lib‘ compiler option
错误展示 Cannot find name 'console'. Do you need to change your target library?ging the 'lib' compiler option to include 'dom'. 2 console.log("当我唱起这首歌"); ~~~~~~~ at createTSError (D:\Software\node-v14.8.0-win-x64\node-global\node_modules\ts-node\sr原创 2022-01-15 17:25:08 · 2456 阅读 · 1 评论