Answer and Explanation:
Using javascript:
/*This function checks only for ascending order. This function cannot check ascending orders for strings, just integers or floats.*/
function CheckOrder(){
var takeinput= prompt("please enter four numbers")
var makeArray= takeinput.split("");
var numArray= new Array(4);
numArray= [makeArray];
var i;
for(i=0; i<=numArray.length; i++){
var nowElem= numArray[i];
if(numArray[1]){
Alert("let's check to see");
}
else if(
nowElem > numArray[i--]){
Alert("might be ascending order");
if(numArray[i]==numArray[2]){
var almosthere=numArray[2]
}
else if(numArray[i]==numArray[3]){
var herenow=numArray[3];
if(almosthere>herenow){
Alert("numbers are in ascending order");
}
}
}
else(
Console.log("there are no ascending orders here")
)
}
The function above can further be worked on to also check for descending order of four numbers(can also be further developed to check for strings). You need just tweak the else if and nested else if statements thus :
else if(
nowElem < numArray[i--]){
Alert("might be descending order");
if(numArray[i]==numArray[2]){
var almosthere=numArray[2]
}
else if(numArray[i]==numArray[3]){
var herenow=numArray[3];
if(almosthere<herenow){
Alert("numbers are in descending order");
}
}
}