Add `toNumber` and cleanup `toString`. Plus a wide range of tests. #1577
referenced this pull request
Oct 28, 2015
That should cover most of the basic use cases, and catch any basic bugs/deficiencies. There are plenty more that could be added to catch other bugs, like I mentioned with Opera where an object has valueOf defined but it's not a function. Other (highly)possible environment deficiencies are regarding whitespace, where the native trim does not trim correctly. Which some could be corrected by if value is string then return +trimmed rather than fall through to return +value. This still leaves return +value coercion open to environment deficiencies.
I've created a (more) optimised version (I think a little more could be done), instead of calling lodash methods. I don't know if you'd prefer this instead, as it looks like I need to rebase again?