Reference: http://2660311.blog.51cto.com/2650311/1358226/
1) Type, native Type, object type (types, primitive types, objects types)
Unlike when we were learning Java, we were told that Java was the language of full OOP: class is an abstraction of a class of objects with common characteristics, object is a specific implementation under a class, the object class is the top-level parent of all classes, and the knowledge of Java begins with classes and objects. JavaScript is not, it is the type of the Number,string, Boolean, object, Function,array, etc. that are encountered in various languages.
These types are divided into two main categories in JS: Primitive Type and object type, primitive types include: number,string, bool, null, undefined; the remaining non-native type objects are object types, including: object, array, function, etc. The object here specifically refers to objects with attributes (attribute), and the code examples in Firebug are as follows:
1 //1) Primitive Types2Logtypeof1);// Number3Logtypeof"");//string4Logtypeof false);//Boolean5Logtypeofundefined);//undefined6Logtypeof NULL);//object NULL is a special column, which belongs to the native type;7LogNULL instanceofObject);//false8 //2) object types.9Logtypeof NewObject);//ObjectTenLogtypeof NewFunction);//function OneLogtypeof NewArray);//Object A -Log (Opts.call (NewObject));//[Object Object] -Log (Opts.call (NewFunction));//[Object Function] theLog (Opts.call (NewArray));//[Object Array]
It is meaningless to judge what a value is, and it is often necessary to determine what type of native or object it is: Judging the native type, you can use the TypeOf keyword, and you can use the ToString () method to determine the object type. Don't understand
JavaScript prototype (i)