Lines Matching refs:duck
6 If you're familiar with the concept of ["duck
9 order to "clearly be a duck".
41 // `duck` must implement `Quackable` for this function to work. It doesn't
42 // matter what type or class duck is, as long as it implements Quackable.
43 function doStuffToDucks (duck) {
44 if (!duck.isADuck()) {
45 throw new Error('I want a duck!')
47 console.log(duck.walk())
48 console.log(duck.talk())
91 Duck typing is a common term for this sort of thing: If it walks like a duck,
92 and it talks like a duck, then it may as well be a duck, as far as any of our
115 // something to be "like a duck", as far as our code is concerned.