If you need to convert a string value to a numeric value, there are a few ways to do it.
One option is to use the parseInt()
function:
parseInt("78963", 10); // 78963
If the value includes decimals, you can use the parseFloat()
method:
parseFloat("78963.1"); // 78963.1
Another shortcut is to simply add a plus sign before the string:
+"78963"; // 78963
If you just need to remove single quotes from a string, you can use the replace()
method:
"'78963'".replace(/'/g, ""); // "78963"
Alternatively, you can split the string using single quotes and access the value at index 1:
"'78963'".split("'")[1]; // "78963"