why?call,apply,bind干什么的?为什么要学这个? 一般用来指定this的环境,在没有学之前,通常会有这些问题. var a = { user:"追梦子", fn:function(){ console.log(this.user); } } var b = a.fn; b(); //undefined 我们是想打印对象a里面的user却打印出来undefined是怎么回事呢?如果我们直接执行a.fn()是可以的. var a = { user:"追梦子&quo…
call,apply,bind方法一般用来指定this的环境. var a = { user:"hahaha", fn:function(){ console.log(this.user); } } var b = a.fn; b(); //undefined 我们是想打印对象a里面的user却打印出来undefined是怎么回事呢?如果我们直接执行a.fn()是可以的. var a = { user:"hahaha", fn:function(){ console…
why?call,apply,bind干什么的?为什么要学这个? 一般用来指定this的环境,在没有学之前,通常会有这些问题. var a = { user:"追梦子", fn:function(){ console.log(this.user); } } var b = a.fn; b(); //undefined 我们是想打印对象a里面的user却打印出来undefined是怎么回事呢?如果我们直接执行a.fn()是可以的. var a = { user:"追梦子&quo…
原文:https://github.com/yangshun/front-end-interview-handbook/blob/master/questions/javascript-questions.md 最近将持续翻译JavaScript面试题,希望对各位有所帮助. (文章中斜体字部分为译者添加) 目录: Part 1(事件委托/this关键字/原型链/AMD与CommonJS/自执行函数) Part 2 (null与undefined/闭包/foreach与map/匿名函数/代码组织)…
AMD - Learning JavaScript Design Patterns [Book] - O'Reilly The overall goal for the Asynchronous Module Definition (AMD) format is to provide a solution for modular JavaScript that developers can use today. It was born out of Dojo’s real world exper…
时间 2016-01-27 05:40:46 Raymond Camden's Blog 原文 http://www.raymondcamden.com/2016/01/25/survey-results-learning-javascript/ 主题 JavaScript A few weeks back, Rebecca Murphey tweeted out a link to a survey she was running involving how people learn Ja…