stay js After declaring and defining a function in , In addition to the formal parameters passed in when defining , The function also receives 2 Two additional parameters :this and arguments.

this The value of the pointer depends on the mode at the time of the call .

When this function is saved as an attribute of the object , It is called “ Method ”. When a method is called , this Bound to the object .

js Medium this The pointer ( Two ) More articles about

  1. Cookie and Session stay Node.JS Practice in ( Two )

    Cookie and Session stay Node.JS Practice in ( Two ) cookie In the author's last article Cookie and Session stay Node.JS Practice in ( One ) It has been written in detail , If you are interested, you can browse through , This article is s ...

  2. The first 22 piece js Medium this How to use the pointer

    Front handle js The related knowledge of , Today js Context in this, For strongly typed languages ,this The usage of is very simple , Because they don't js Unique dynamic binding . First look at the following code : function funcA() { thi ...

  3. JS Medium this The pointer

    1.JS in this Pointer to JS Of functions in this Not following the lexical scope rule ( That is, the scope is determined by where it is declared ), It depends on how the function is called influence this The factors of pointer are as follows : Whether the method is called by an object , such as ...

  4. js Medium this How to use the pointer

    First look at the following code : function funcA() { this.name = "hello"; console.log(this.name); this.show = funct ...

  5. js Medium this The pointer ( 5、 ... and )

    js There's one interesting thing about functions in , That is to say, the function itself is also a method . apply Method allows us to create an array of parameters and use it to call functions . apply Method accepts two arguments , The first is to be bound to this Value . The second is an array of parameters ...

  6. js Medium this The pointer ( 3、 ... and )

    When a function is not the confession of an object , It will be called as a function . here , Function this The pointer is bound to a global object . consequence : Methods can't use inner functions to help work , because this Wrong value bound , The method will not be shared ...

  7. stay Node.js Use in RabbitMQ Series two Task queue

    In the last article Node.js Use in RabbitMQ A series of Hello world I used a task queue , But the scene was to send a message to a consumer , In this article, I'm going to talk about scenarios with multiple consumers . Actually , The core of the task queue ...

  8. In depth understanding of JS Objects in the ( Two ):new How it works

    Catalog preface Constructors with different return values thorough new Call function principle summary Reference resources 1. preface stay In depth understanding of JS Objects in the ( One ): Prototype . Prototype chains and constructors in , We analyzed JS Whether everything in is an object and its prototype . Prototype chain and construction ...

  9. JS in : Arrays and two-dimensional arrays 、MAP、Set And the use of enumeration

    1. Arrays and two-dimensional arrays :   Method 1 : var names = ['Michael', 'Bob', 'Tracy']; names[0];// 'Michael' Method 2 : var mycars=new ...

Random recommendation

  1. IT How to protect eyesight

    Recently, I feel that my eyes are more uncomfortable , A little dry , I guess it's because of my wife iPhone5C The back screen is too small , And I'm a major mobile phone addict . In order to keep yourself 5.0+ The vision of , Did the following work , Share it with you : Win7 The computer zooms in the font to 1 ...

  2. 35. stay PCB Delete component from

    stay PCB Editor Inside , If you want to do something , First you have to click on this command , Then click on the area you want to operate / Components , Finally, right-click to select "Done", So you can complete an operation .

  3. HDURevenge of Segment Tree( The second long increasing subsequence )

    HDURevenge of Segment Tree( The second long increasing subsequence ) Topic link The main idea of the topic : The problem is to find the second longest increasing subsequence . Their thinking : use n^2 The algorithm to find LIS, But here we need to record whether the longest sequence is ...

  4. Redis Stand alone installation

    1. A brief introduction to the tools 1. Bloggers use Xshell Tools ps: You need to set the port and connection name , The default port is 22, The children's shoes you need can be Baidu by yourself 2.Redis Stand alone installation First step : install gcc Compile environment yum instal ...

  5. CRT restart Was

    enter one user name . After password login # ps -eaf | grep websphere Find the way  /usr/IBM/WebSphere/AppServer/ Get into /usr/IBM/WebSphere/AppS ...

  6. mysql ERROR 1451 (23000)

    Problem description : An error is as follows :ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint There are foreign key constraints , ...

  7. Flask web The road of development

    ge Request and post request ### get Request and post request :1. get request : * Use scenarios : If you only get data from the server , There's no impact on the server , Then use get request . * The ginseng :get The request is to release ...

  8. To configure vim

    VundleVuldle It's a fully automatic plug-in manager , Let's manage plug-ins by maintaining a list of plug-ins . It's for installation . to update . Removing plug-ins provides a convenient command . In the installation Git Under the circumstances ( This article is not exhaustive Git Installation ), Enter the command : git c ...

  9. QuestaSim Automated simulation do file

    One . Write basic do file Next, follow the steps of the actual simulation to illustrate do All the things that need to be used in the file tcl command . 1.quit -sim ---- Quit the original simulation project : 2.cd ---- Set the path to the working directory , It's the simulation engineering road ...

  10. mongooseim xmpp The server docker Install trial

    remarks :     Preparatory environment docker  xmpp client   1. start-up mongooseim docker run -d -t -h mongooseim-1 --name mongooseim- ...