07 2021 档案
摘要:前言 近日刷编程题过程中发现善用 replace 及正则在处理数据时能做到极大的优雅简洁,特此记录分享一下。 replace 基本用法 语法: replace(regexp, string || function) 这里先介绍一下 replace 第二个参数可以传入两种类型: 1、字符串 传入字符串
阅读全文
摘要:预先了解 setState 的两种传参方式 1、直接传入新值 setState(options); 列如: const [state, setState] = useState(0); setState(state + 1); 2、传入回调函数 setState(callBack); 例如: con
阅读全文

浙公网安备 33010602011771号