class: a description of a collection of objects with the same characteristics;
object: An individual of a real existence;
* * Object-oriented rather than class-oriented.
1. All objects, inherit by the prototype chain, polymorphism by weak type, encapsulation ... Although it can be closed, but I personally more like Python, the underline represents the private style
2. Human beings, for example, refer to a range; an object: A person, for example, refers to a specific object in this range.
When function in 3.Javascript is a constructor, it is a class that, with the new operator, can return an object.
Of course, to generate an object, you can also use the literal form, such as var obj = {x:1, y:function () {}};
A class can be understood as a template, and an object is a concrete instance created from this template.
Instanceof determine whether an object belongs to a class
Object Instanceof Constructor
Own parent parent ....
Constructor determine the immediate parent
1.Object instanceof Function True
Object Instanceof Object True
function instanceof Function True
Function instanceof Object True
2.
var arr = new Array ();
var date = new Date ();
Arr instanceof Array True
Date Instanceof Date True
if (date.constructor==date) {alert (true)} True
Data.prototype.constructor=array
The understanding of classes and objects in JS