Question: Help with javaScript NOTE: Use proper ES6 syntax including using let/const, strict equals, no global variables, etc. Use proper indentation and formatting . Do NOT

Help with javaScript

NOTE:

  • Use proper ES6 syntax including using let/const, strict equals, no global variables, etc. Use proper indentation and formatting.Do NOT use Regex.

1) Write a function called LocateandReplace.

  • This function accepts three arguments which are all strings and the function returns a string.
  • The function uses the first argument to find a character in the given string phrase and replace it with the character given as the second argument.
  • Finally, it then returns the string phrase with the character properly replaced. The replace should be case-sensitive.

Like:

function LocateandReplace( str1, str2, str3 ){

return str;

}

console.log(LocateandReplace('/', 'a', ' J / v / script '));

EXPECTED OUTPUT (string): 'Javascript'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!