I'm trying to make the short Javascript code throw an alert and show 93 instead of 0-93 but it's not working ?
<html>
<head>
<script type="text/javascript">
function numberFromInput(value) {
return alert(Number(value.match(/[-]?(\d*)$/).pop()));
}
</script>
</head>
<body>
numberFromInput(0-93);
</body>
</html>
<script>tag as well. Otherwise, yournumberFromInput(0-93);is just a text node on the page.value.match, but the value you pass is aNumber(0 - 93will evaluate to-93)