摘要: let和const 1、ES6新增了let命令,用来声明变量。它的用法类似于 "var" ,但是所声明的变量,只在let命令所在的代码块内有效。下面代码在代码块之中,分别用let和var声明了两个变量。然后在代码块之外调用这两个变量,结果let声明的变量报错,var声明的变量返回了正确的值。这表明, 阅读全文
posted @ 2020-05-06 23:45 PrimerPlus 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Map Prior to ES6, when we require the mapping of keys and values, we often use an object. It is because the object allows us to map a key to the value 阅读全文
posted @ 2020-05-06 17:42 PrimerPlus 阅读(146) 评论(0) 推荐(0) 编辑