摘要: ES5(JS)中定义匿名函数: const myFunc = function() { const myVar = "value"; return myVar; } ES6中定义匿名函数: const myFunc = () => { const myVar = "value"; return my 阅读全文
posted @ 2022-09-12 20:52 枭二熊 阅读(57) 评论(0) 推荐(0) 编辑
摘要: const Some developers prefer to assign all their variables using const by default, unless they know they will need to reassign the value. Only in that 阅读全文
posted @ 2022-09-12 16:23 枭二熊 阅读(219) 评论(0) 推荐(0) 编辑
摘要: When you declare a variable with the var keyword, it is declared globally, or locally if declared inside a function. 当使用var关键字声明变量时,它是全局声明的(在循环语句中声明也是 阅读全文
posted @ 2022-09-12 11:16 枭二熊 阅读(79) 评论(0) 推荐(0) 编辑