摘要:
问题代码 import {useState,useEffect} from 'react' const useData = () => { const [data,setData] = useState({count:0}); useEffect(()=>{ setTimeout(()=> { se 阅读全文
posted @ 2021-04-26 09:06
浅笑19
阅读(418)
评论(0)
推荐(0)
摘要:
Objects 和 maps 的比较: Object的键只能是字符串或者 Symbols,但 Map 的键可以是任意值,包括函数、对象、基本类 型。 Map 中的键值是有序的,而添加到 Object 对象中的键则不是。因此,当对它进行遍历时,Map 对象是按插入的顺序返回键值。 可以通过 size 阅读全文
posted @ 2021-04-26 08:59
浅笑19
阅读(9202)
评论(0)
推荐(0)
摘要:
简单的定义 const numArr:number[]=[1,2,3] const strArr:string[]=['a','b','c'] const undeArr:undefined[]=[undefined,undefined] 数组中有字符串又有数组的类型 const arr:(numb 阅读全文
posted @ 2021-04-26 08:56
浅笑19
阅读(216)
评论(0)
推荐(0)
摘要:
for..in loops iterate over the entire prototype chain, which is virtually never what you want. 意思是使用for..in会遍历整个原型链,这样不是很好的实现方法,推荐使用Object.keys formRu 阅读全文
posted @ 2021-04-26 08:54
浅笑19
阅读(532)
评论(0)
推荐(0)
The body of a for-in should be wrapped in an if statement to filter unwanted properties from the pro
摘要:
ESLint模式下for in遍历对象会报错,可以这样解决: let val = { shu: [1, 2, 3] }; for (let item in val) { if (val.hasOwnProperty(item)) { console.log(item); } } 因为我们在遍历一个对 阅读全文
posted @ 2021-04-26 08:51
浅笑19
阅读(2017)
评论(0)
推荐(0)
摘要:
ps命令将某个进程显示出来 grep命令是查找 中间的|是管道命令 是指ps命令与grep同时执行 PS是LINUX下最常用的也是非常强大的进程查看命令 grep命令是查找,是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。 grep全称是Global Regular Ex 阅读全文
posted @ 2021-04-26 08:49
浅笑19
阅读(796)
评论(0)
推荐(0)
摘要:
import moment from 'moment'; moment.locale('zh-cn');或者moment.lang('zh-cn');即可显示中文 阅读全文
posted @ 2021-04-26 08:46
浅笑19
阅读(213)
评论(0)
推荐(0)

浙公网安备 33010602011771号