So your woof method is actually a static method (if you use java. Basically, it hangs on the Dog function and can be accessed without an instance of Dog. Ie: Dog.woof ())
To make it work with a dog instance, you want to make sure that it is a prototype definition (again, with the analogy of Java, defining an instance method is effective). As qwertymik said,
Dog.prototype.woof = function(){ console.log( "Woof!" ); this.speak(); }
Then you can do
var foo = new Dog(); foo.woof();
source share