Sorted Array - No feedback

I am trying to solve this in Nodejs. But not sure if its right or wrong. No feedback given ffrom the compiler.

function isSorted(array){
if(array.length === 1){
return true;
}
const isPrevSorted = isSorted(array.slice(1));
if(isPrevSorted && array[0] < array[1]){
return true;
}
return false;
}

function isSortedArray(n, nums){
const array = nums.split(’ ').map(n => parseInt(n));
console.log(typeof array[0]);
const result = isSorted(array);
console.log(result);
}

isSortedArray(3, “1 2 3 4 5”);

Hey @abhidatta146 You code looks good to me.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Hey @abhidatta146 Send your code here.