- 博客(3)
- 收藏
- 关注
原创 浅谈对this的理解
"this" 是个关键词,是个存放指针的变量。前提是在js中,别的语言我更不清楚了:1、 this 默认指向 是 window e.g var name ='mongo';console.log(this.name) // mongoconsole.log(this) // window2、如果给元素添加了事件,当元素
2017-05-31 10:13:01
1672
2
原创 js面试题Foo.getName()的故事
首先声明下:此题是本人面试时笔试题中的一道,回来一搜居然雷同,纯属偶然,特写此篇来整理一下思绪。。。原题: function Foo() { getName = function () { console.log (1); }; console.log('this is'+this) return this; } Foo.getName =
2017-05-30 16:16:23
11756
1
原创 一道有关setTimeout的面试题
setTimeout 只执行一次 可用来实现js代码异步执行setInterval 循环执行console.log((function(){ console.log(1); setTimeout(function(){ console.log(2) },1000) setTimeout(function(){ console.log(3)
2017-05-28 17:28:41
1622
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人