Im doing intro to JS in a site called CodeHS. I believe I did the assignment its asking of me right but it says its wrong?
Here is what it wants me to do:

Here is what I did:

Heres what I apparently got wrong:

Ive run this code many times and it worked flawlessly, so why does it give me these errors?
You forgot to add a blank line inside the end of your while block, which also accounts for the line number. You should check the IMPORTANT note on the assignment.
I agree with @Jorge. You need to include the new line character '\n' at the end of the appropriate print statements, for the sake of the marking program. Try it like this:
while(numItems > 0) {
println('We have ' + numItems + ' in inventory.');
var buy = readInt('How many items would you like to buy?');
if(buy <= numItems) {
numItems -= buy;
println('Now we have ' + numItems + ' left.' + '\n');
} else {
println('There is not enough in inventory for that purchase.' + '\n');
}
}