JavaScriptLearn the basic grammar of notes. For students who are not familiar withJavaScriptand are not familiar with the basic grammar ofJavaScript, you can save it and take a look!
You can check the reference links at the end of the article.
The following contents are all different parts of JavaScript.
This article first talks about the differences in several details in the above content.
1. Congruence judgment
There is a congruence judgment === in JavaScript comparison operator, which is used to judge whether the value and type are both equal.
2.for/in loop
The for/in loop in JavaScript is a bit like the enhanced for loop in Java, but it is used
Traverse the properties of the object.
var person={fname:"John",lname:"Doe",age:25}; for (x in person) { txt=txt + person[x]; }
Copy after login
Where x is the attribute name, person[x] is the value of the attribute.
3.With statement
With the With statement, when accessing the objectproperties and methodsThere is no need to repeatedly specify the reference object. In the With statement block, all properties and methods that are not recognized by JavaScript are related to the object specified by the statement block. Function: Create a default object for a program.