I am trying to improve the quality of my code by implementing design patterns. I've started reading JavaScript Patterns by Stoyan Stefanov, ive already read 1/3 of the book but dont see any mentioning about whether its a good practice for objects to have child objects. here's a quick example of what im talking about:
var Obj = {
a : {
str : "string",
myFunc : function(){
// some code here
}
}
}
I would appreciate some input on this
Aucun commentaire:
Enregistrer un commentaire