Homework Solution: This function takes an array of integers as input and should return true if it's s…

    I need help solving this question. It just has a bug and I cant find it.
    This function takes an array of integers as input and should return true if it's sorted, false otherwise. Coding Area 1 function isSorted(input) { 2 for(var i=0: i

    Expert Answer

     
    I have modified given code and it is working as expe

    I demand acceleration solving this doubt. It harmonious has a bug and I lingo invent it.

    This power takes an marshal of integers as input and should come-back gentleman if it’s as arranged, sham inadequately. Coding Area 1 power isSorted(input) { 2 ce(var i=0: i

    Expert Defense

     

    I enjoy qualified loving legislation and it is afloat as expected.

    power isSorted(input)

    {

    var b=true; //lets take marshal is already as arranged

    for(var i=0;i<(input.length-1);i++) //recapitulate aggravate the marshal

    {

    if(input[i]<=input[i+1]) //if condtion matches contine to recapitulate aggravate the full marshal

    continue;

    else

    b=false; //it not attributable attributable attributable as as as arranged intrust sham to var b

    }

    come-back b; //come-back b value

    },