Re:Show HN: A library to record and intercept JavaScript at ...
by astral303 on Saturday September 09, 2017 @11:43AM
(#15207587)
This is not polymorphism. This is type coercion.
[ Parent
| on HN ]
Re:Show HN: A library to record and intercept JavaScript at ...
by k__ on Saturday September 09, 2017 @01:09PM
(#15207948)
Why not?
you have a function that takes something that is polymorphic in the sense that I can be added. A string and a number aren't the same type, but they share some kind of interface.
Re:Show HN: A library to record and intercept JavaScript at ...
by yorwba on Saturday September 09, 2017 @12:20PM
(#15207735)
Type coercion is involved, but that's not mutually exclusive with polymorphism. Type coercion itself is a polymorphic operation, since it applies to parameters of multiple different types.