Js deep learning-object and js deep learning object
Many articles have introduced that JavaScript is a programming language. Since object-oriented programming must have objects, what are the differences between JS objects and object definitions in other object-oriented programming languages.
1.C #The object is a class instance. An int type variable is an object. A structure type variable is also an object that customizes a person's type, instantiates a variable, and is also an object.
2. js object.W3schoolThe introduction of some objects is a bit silly and unclear about the objects. Whether it is a type instance or a type, so I think it is the same for c. A type instance is an object.
Search for js object creation methods on the Internet, and you will often create blogs in several ways of object creation, mainly in the following concentration.
First
Var clock = {hour: 12, minute: 10, second: 10, showTime: function () {alert (this. hour + ":" + this. minute + ":" + this. second) ;}} clock. showTime (); // call
I understand him as follows: Create a type that is executed immediately and only once, and return this type of instance to clock.
Therefore, you must first create a type, and the instance is the object.
Second
Var clock = new Object (); clock. hour = 12; clock. minute = 10; clock. showHour = function () {alert (clock. hour) ;}; clock. showHour (); // call
In this better understanding, we first create an object instance, and then add attributes and methods to the instance,
Therefore, you must first create a type, and the instance is the object.
Third
function clock(hour,minute,second){ this.hour = hour; this.minute = minute; this.second = second; this.showTime = function(){ alert(this.hour+":"+this.minute+":"+this.second); } } var newClock =new clock(12,12,12); alert(newClock.hour);
First define a clock type, and then instantiate this type, so the object is still a type instance.
Therefore, you must first create a type, and the instance is the object.
How can I thoroughly learn js (javascript) usage and syntax?
Look for several classic collections script books and take the jquery code for a good analysis. Learn the design ideas of experts and js usage skills. In addition, almost all js functions are used in the framework, you can also deeply understand the standard usage of these functions.
I want to learn more about JS. Who has a good PDF? I am willing to share information with him. I also have a lot of information .....
We recommend that you read this book "Javascript authoritative guide". It is now version 5th. After reading this book, you will have a deep understanding of js. You can download an English ebook. CHM format. I have one. 340036631