For this Question: An array of 5 string is given where each string contains 2 characters, Now you have to sort these strings, like in a dictionary.Input contains 5 strings of length 2 separated by spaces.
String contains only uppercase English letters.Print the sorted array.INPUT : 
AS KF ER DD JK

OUTPUT : 
AS DD ER JK KF, I have written this Solution Code: function easySorting(arr)
  {
    for(let i = 1; i < 5; i++)
    {
        let str = arr[i];
        let j = i-1;
        while(j >= 0 && (arr[j].toString().localeCompare(str)) > 0 )
        {
          arr[j+1] = arr[j];
          j--;
        }
        arr[j+1] = str;
    }
    return arr;
  }, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?