Extend an object's method by running its output through a mutating callback
every time it is called.
The callback accepts the method's return value and should perform any
mutations directly on this value. For this reason, this function will not be
effective on methods which return scalar values (numbers, strings, booleans).
Care should be taken to extend the correct object – in most cases, a class'
prototype will be the desired target of extension, not the class itself.
Extend an object's method by running its output through a mutating callback every time it is called.
The callback accepts the method's return value and should perform any mutations directly on this value. For this reason, this function will not be effective on methods which return scalar values (numbers, strings, booleans).
Care should be taken to extend the correct object – in most cases, a class' prototype will be the desired target of extension, not the class itself.