After encountering a topic, write down the following output:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/D4/wKioL1WqNTrzBr2dAAErXTaksLM774.jpg "title=" Pic1.png "alt=" Wkiol1wqntrzbr2daaerxtakslm774.jpg "/>
The results are as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/D4/wKioL1WqNdizNEN-AABALOyVSeI532.jpg "title=" Pic2.png "alt=" Wkiol1wqndiznen-aabaloyvsei532.jpg "/>
first child ' s Name is not a problem, the second specified is also child, still child's name, the third and second is actually the same, (Parentobj.child=parentobj.child) equivalent (Parentobj.child), It's a function name, and the fourth is what the ghost is.
The comma operator is rare, and it is known that when you use the comma operator , the value of the left operand is evaluated, the value of the right operand is evaluated, and the value of the right operand is returned . Therefore,(Parentobj.child,parentobj.child) and the first three are the same. The precedence of the comma operator is the lowest in JavaScript, and can be error-prone if used to wrap it up in parentheses. However, I think the comma operator is seldom used.
Take a look at an example on the Internet to find out how this is used:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/D4/wKioL1WqPmbzsrElAAC9FUsxOlQ326.jpg "title=" Pic3.png "alt=" Wkiol1wqpmbzsrelaac9fusxolq326.jpg "/>
The result is
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/D4/wKioL1WqPzzywxa8AABPl0eGjMA546.jpg "title=" Pic4.png "alt=" Wkiol1wqpzzywxa8aabpl0egjma546.jpg "/>
FN (); then why is This.length , because the FN function is defined globally, the FN function of this point is the window, as you can see.
I know all the principles, arguments[0] (); What the hell?
Arguments is a built-in object of JavaScript, note that it is not an array, but an object.
So Arguments[0] is to find the value of key 0, this value is the function name FN, because it is the first parameter, OK, then the FN here can only point to argument, because FN itself does not have the length of this variable, Look outside and find the arguments. Arguments there is a length attribute, do not believe me to expand the last function to show you:
OK, the truth, this time this.length is 1, length is the number of parameters, there is only FN, 1.
The comma operator and this in JavaScript