Question: JAVASCRIPT For this question you will need to use the following function: string_value.replace(/x/g,y) returns the text in string_value except that any instance of x is

JAVASCRIPT

For this question you will need to use the following function: string_value.replace(/x/g,"y") returns the text in string_value except that any instance of x is replaced by y Define a function named translate which has one input. The input is a String and its value will be some text. The function will return that text translated into Canadian English. Write your function so that it start by getting the result of replacing all of input's instances of "color" with "colour". Using the result of that initial function call, replace all instances of "\. " with ". Sorry. " (for this second replacements, the first string must include the backslash and both strings end with a single space). Your function should return the Canadian English String.

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 Databases Questions!