JavaScript. Objects. Constructors
In this tutorial we continue to consider objects in javascript, Consider other ways object creation. One of them is constructor function.
Remember last lesson we have got a problem – how to create objects on massive scale.
For this purpose javascript has constructor functions. Iт fact it looks like normal function. There is a rule to write constructor function name with a capital letter not to be confused with other functions. You have already heard about constructor functions – in last lessons we used builtin javascript functions. For example Date object. You must use new keyword while creating objects with constructpr function.
For this purpose javascript has constructor functions. Iт fact it looks like normal function. There is a rule to write constructor function name with a capital letter not to be confused with other functions. You have already heard about constructor functions – in last lessons we used builtin javascript functions. For example Date object. You must use new keyword while creating objects with constructpr function.
0 Comments