Just a personal opinion here ... but I prefer the dog style notation for long-term maintainability.
All dog codes remain in the dog definition. Imagine this after 5 years, and the โnext guyโ will be asked to remove the hasTail property. No matter how many other objects / properties / etc. were defined between them and now, he will find it in the definition of a dog.
For comparison ... imagine this after 5 years, and the "next guy" will be asked to remove the hasTail property from "cat". It should scan the / grep / ctl + f animals.js file for hasTail and hopes it will remove the correct one.
source share