Can you help with a JavaScript challenge? I am looking to create a loop that continuously asks the user for input until they type "exit". Once they do, I want the program to display the minimum value that was entered.
var students = prompt("Enter Student Name: ");
var studentArr = new Array(students);
var mark = parseInt( prompt("Enter Student Mark: ") );
var markArr = new Array();
function min (mark){
var min = Number.MAX_VALUE;
for(var i = 0; i < mark.length; i++){
if(parseInt(mark[i]) < min)
min = parseInt(mark[i]);
}
return mark;
}
var smallest = min(mark);
document.write(smallest);