First, hello world o (^ ▽ ^) o
For more than a year,What this language brings me is not only a high return on work,There are many unexpected surprises,Let me be an art student to appreciate the charm of programming.
starting today,Ready to update my blog every Monday,More than just sharing,Encourage yourself.
Those who have been exposed to other object-oriented programming languages (such as:java, c, c++, etc.) may be familiar with this.
Let's first talk about his differences from other programming languages
But as a separate pointer,Under different circumstances,Pointing to different positions,That's why we confuse it.
Let ’s take a lookWhat kind of form does it have in different situations?
1. In global scope:
This is best understood,That is, in the global scope, this points to window, that is, in the global scope,this is equivalent to window:
This is because,When instantiated,This function becomes an instance object,The internal this also naturally points to this instance object,As this at the same beginning points to the window object, it points to its instance.
Note:this as a keyword,You cannot duplicate it.
unconsciously,Written much better,In fact, this has more forms.Prototype, such as in html, such as in the dom event handler,Due to the length,Ao Shu will not continue here,Next time I will talk about this in prototype
this as a pointer in my understanding,Correspondingly, it will have a more important position in the prototype chain of prototypes.But outside our scope today,Do not explain too much
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- xcode - pod install [!] no `podfile 'found in the project directory
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file