We continue with the design pattern more commonly used in Javascript.
Singleton design pattern is used to ensure that only one instance of the object is created.
Singleton Pattern
var SingletonObject = {
Model : "Ferrari",
Color: "Red",
ToString: function() {
return "Model: " + this.Model + ", Color: " + this.Color;
}
}
Singleton design pattern is used to ensure that only one instance of the object is created.
Singleton Pattern
var SingletonObject = {
Model : "Ferrari",
Color: "Red",
ToString: function() {
return "Model: " + this.Model + ", Color: " + this.Color;
}
}
Comentarios
Publicar un comentario