javascript Programming Glossary: quack
Does JavaScript have the interface type (such as Java's 'interface')? http://stackoverflow.com/questions/3710275/does-javascript-have-the-interface-type-such-as-javas-interface what's called duck typing . If it walks like a duck and quacks like a duck as far as JS cares it's a duck. If your object.. a duck as far as JS cares it's a duck. If your object has quack walk and fly methods code can use it wherever it expects an.. can use it wherever it expects an object that can walk quack and fly without requiring the implementation of some Duckable..
Javascript when to use prototypes http://stackoverflow.com/questions/4736910/javascript-when-to-use-prototypes to mark objects as implementing that interface var duck quack function ... duck.quack we're satisfied it's a duck In other.. that interface var duck quack function ... duck.quack we're satisfied it's a duck In other words if each type of object..
|