Recently, I've been struggling to convert a string in this format into a number:
"20150910095820526"
Despite trying different methods like unary operators, parseInt, and parseFloat, the outcome is always off, ending up like this:
1017219000
I've attempted the following code snippets:
element = parseFloat(element);
element = parseInt(element, 10);
element = ~~element;
This is the full code snippet:
$scope.episodes.forEach(function(element) {
console.log(parseFloat(element));
}, this);
I'm seeking advice - where am I going wrong? Thank you.