Hướng dẫn thử thách
1 / 1
Build a Smart Word Replacement Function
In this lab, you will create a function that performs a search and replace on the sentence using the arguments provided and then returns the new sentence.
**Note:** Preserve the case of the first character in the original word when you are replacing it. For example if you mean to replace the word `Book` with the word `dog`, it should be replaced as `Dog`
**Objective**: Fulfill the user stories below and get all the tests to pass to complete the lab.
**User Stories:**
1. You should create a function named `myReplace`.
1. The `myReplace` function should take three arguments: a string, a word to be replaced, and the word to replace it with.
1. The `myReplace` function should return the new string with the replacement.
1. You should preserve the case of the first character in the original word when you are replacing it.
Vượt qua bài kiểm tra hiện tại để mở khóa bài tiếp theo.
main.js
UTF-8 • Tab Size: 2Kiểm tra bài:⌘↵