JS solution for the problem not working in editor


#1

function kthsmallest(A, B){

    var sortedA = A.sort(function(a,b){ 
        if(a<b)
        { return -1; }
      });
    return sortedA[B-1];
}

This code is returning cirrect result for me in the browser or any other complier but its not working in the this editor.