The goal of this exercise is to write functions in the editor to the left that pass test cases for the functions shown below. Whenever you are ready to run the tests, hit the button above the editor. To see the specification for a function you are supposed to write, click a button in the test panel. (You will need to click the once first.) Once you have written the function with the right name, the button will indicate whether the test cases are all passing (green, with a ✅) or some are failing (red, with an ❌) and clicking the button will show the results of the individual test cases.

🚨 New material alert 🚨Some of these functions will be much easier (even trivial) to write if you use the indexOf method that exists on strings. It takes a single argument, which should be a string, and returns the index in the string on which it was called of the first occurrence of the argument string or -1 if it is not found. For instance if s is our old standby "foobar" then s.indexOf("bar") is 3.

Put definitions here.

Revisions: