1 implicit conversion rules for javascript:
If there is a Boolean type, it is converted to a numeric value for comparison.
If there is Nan, return false
If the string, then divided into three cases: the other side is a string directly compared, the other is a numeric value, then the string into a numeric value, if the other side is the object, then the object with the ToString () method to convert, and then compare. Finally, if other, return false.
If the number, if the other side is the object, with valueof () to compare, the rest return false
NULL and defined do not perform type conversions, but they are equal.
2 break and continue in javascript:
Both can jump out of the code block, but for break, it jumps out of the loop, and for continue, it just jumps out of the loop, and if the number of cycles is not reached, the loop continues.
In addition, JavaScript statements can be tagged in JavaScript, at this point:
Continue statements (with or without label references) can only be used in loops.
The break statement (without a label reference) can only be used in loops or switch.
A break statement can be used to jump out of any JavaScript code block with a label reference
3 Form Validation
JavaScript can be used to validate these input data in an HTML form before the data is sent to the server.
These typical forms of data that are validated by JavaScript are:
- Has the user filled out the required fields in the form?
- is the email address entered by the user legal?
- Has the user entered a valid date?
- Does the user enter text in the Data field (numeric field)?
4 prototype chain
In JavaScript, each object has an internal property [[prototype]], the value of the prototype can be an object, or it can be null, and if the value of the prototype is an object, then it has its own internal property [[prototype]], and so on, forming a prototype chain.
If you want to access the prototype of an element, you can pass the function getprototypeof ().
Front-end scrambled JavaScript learning Note two