Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converting string to number in Javascript (ES5)
function toNumber(value) {
var convertedNumber = +value;
if (convertedNumber) {
return convertedNumber;
throw Error("Conversion error for value:" + value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.