
js
文章平均质量分 96
苦笔
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
js改变this指向的方法:call apply bind
在函数中使用this function foo(c, d) { return this.a + this.b + c + d } global.a = 3 global.b = 4 // foo执行时,this没有明确的指向,默认指向全局对象global // nodejs中是global,browser中是window foo(3, 4) // 14 ...原创 2018-05-27 13:58:02 · 2312 阅读 · 0 评论 -
js中this的用法
浏览器全局环境(global context) this === window // true原创 2018-05-27 17:18:42 · 2689 阅读 · 0 评论 -
js 闭包(closure)
定义 A closure is the combination of a function and the lexical environment within which that function was declared. This environment consists of any local variables that were in-scope at the time ...原创 2018-03-22 09:51:17 · 230 阅读 · 0 评论 -
es时间对象(Date)
1 定义 // 4种定义方式 new Date().toLocaleString(); // 2018-1-10 20:32:12 // new Date(milliseconds),3年约等于11次方毫秒 new Date(0).toLocaleString(); // 1970-1-1 08:00:00,不知道这是个什么日子 new Date(1515原创 2018-01-11 22:18:55 · 5294 阅读 · 1 评论 -
JS中数值常量的含义,数值的运算
Number.MAX_VALUE Number.MIN_VALUE Number.MAX_SAFE_INTEGER Number.MIN_SAFE_INTEGER Number.EPSILON ES采用Binary64 0.1 + 0.2 =原创 2018-10-25 19:41:10 · 1348 阅读 · 0 评论