Search and Replace challenge

Tell us what’s happening:

dont know y its not working

Your code so far

function myReplace(str, before, after) {
 var arr=Array.from(arguments);
  if(arr[1].charAt(0)>=65 && arr1.charAt(0)<=90){
  return str.replace(arr[1],arr[2]);

myReplace("He is Sleeping on the couch", "Sleeping", "sitting");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36.

Link to the challenge:

I didn’t checked the logic , anyway there’s a typo ( it seems ):
arr1.charAt(0)<=90) // arr[1]?