Giter VIP home page Giter VIP logo

Comments (4)

mydaoyuan avatar mydaoyuan commented on July 3, 2024 8

this绑定有四种情况;

  1. 默认绑定:函数独立调用时,this默认绑定到window
  2. 隐式绑定:看函数调用栈,上一个的栈点就是this,console.trace()可查看函数的调用关系
  3. 显式绑定:如call,apply,bind,this指向绑定对象
  4. new绑定:this指向new出来的对象

from frontend-interview.

VamKram avatar VamKram commented on July 3, 2024

(1)this -> obj
(2)this -> window
(3)this -> {number : 20}

from frontend-interview.

Jemair avatar Jemair commented on July 3, 2024

60 50 20
原因上面写了

from frontend-interview.

Reckfu1 avatar Reckfu1 commented on July 3, 2024

605020

from frontend-interview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.