This is the code I have to use for a little school homework. Now when I type a date in the prompt it's a string and it needs to be converted to a number to work. I'm still a beginner in JavaScript so I don't really know what to do.
<script>
enddate = prompt('What is the end date JJJJ-MM-DD?');
var deadline = enddate;
console.log(deadline);
var now = Date.now();
var day = 86400000;
var remaining = ; //help me here
document.write('<br>There are: ' + remaining.toFixed(0) + ' days left!');
</script>