For example, if we wanted more information on the
.isNan() method, we could Google “MDN isNan” and then click the link to the MDN page. If we were looking to see a list of all of the
String built-in methods, we might Google “MDN String”, click the link to MDN, and then scroll down to the “Methods” section of the documentation.
There are many ways to get to the documentation you are looking for. Find the one that works best for your workflow.
In the code editor, we’ve included a function that is supposed to take a string and return a version of that string repeated twice. For example, you can see in the test case at the bottom of the file, we expect
doubleString('echo') to return
However currently, when we run our file, nothing happens. Clearly we are using the
.repeat() method incorrectly. Let’s find the MDN documentation for
Find the link to the documentation for
String.repeat() and paste it to the end of the comment on line 1.
Now that we’ve found the documentation for
String.repeat(), let’s read the documentation to see what we’re doing wrong. Take a look at the parameters section of the documentation. Can you see why our string isn’t getting repeated?
Using this information, fix the
.repeat() call in our code.