3 ms·
The bunny or toaster example seems to me like someone still thinking in a statically-typed paradigm in a dynamically-typed language. If you stop relying on ins
by techiferous 14y ago
The bunny or toaster example seems to me like someone still thinking in a statically-typed paradigm in a dynamically-typed language.
If you stop relying on instanceof and start using duck typing it would probably work out better.
Or maybe you should just never write a function called doThisOrDoThat. Seems like a code smell.