摘要: 1. includes() 表示是否找到了参数字符串, 返回布尔值。 const str = 'hello world' const res = str.includes('e') // true const res2 = str.includes('a') //false const res3 = 阅读全文
posted @ 2022-03-24 16:30 SKa-M 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 1.基本用法 1.数组的解构 const [a, b] = [10, 100] //a = 10 //b = 100 注意:因为数组没key,所有解构出来的a, b可以任意取名然后使用 2.对象的结构 const obj = { name: "Roven", age: 30 } const { na 阅读全文
posted @ 2022-03-24 15:44 SKa-M 阅读(87) 评论(0) 推荐(0) 编辑
摘要: # 1.不允许重复声明。 (1)var 可以重复声明,覆盖性。 (2)const、let重复声明会报错。 2.var存在变量提升,const、let不存在变量提升。 点击查看代码 (1) console.log(a) var a = 100 --> 打印为undefined (2) console. 阅读全文
posted @ 2022-03-24 14:52 SKa-M 阅读(24) 评论(0) 推荐(0) 编辑