From the course: JavaScript Patterns: Modern Solutions to Common Challenges

How to work with CoderPad challenges

- [Instructor] This course includes automated code challenges that appear when you click the challenge links in the course's table of contents. Each challenge includes instructions and a couple of code editors you can use to create and test your own solution to the challenge. These challenges are hosted by CoderPad and they appear in the same area of the course page where you watch the course's videos. We recommend using a desktop browser for the best experience with code challenges, but you can use the LinkedIn Learning mobile app if you prefer. The code challenge has four areas: Instructions in the top left, a code editor for your answer in the top right, another code editor where you see how your code is used in the bottom right, and a console for output in the bottom left. You can use these drag handles, like this, to reallocate the space as you like. To get even more horizontal space for the code editors, you can collapse the course's table of contents on the left. Each challenge has instructions that include a description of the challenge, and the challenge's parameters and the desired result. Parameters are values that will be passed into your code and they have to be of a particular data type. The return value also has to be of a particular type, and you'll also see that noted in the instructions. The Constraints section, if included, has useful information about the parameters that will be passed in. The examples show different parameter values and what the result would be for each of those test cases. You'll create your answer in the top right code editor. There are usually comments in the starting code showing where to put your solution. When you click Test my code, you'll see a message indicating whether your code returned a correct result. Initially, it will be incorrect. If your code isn't successful, you can ask for help. Each of these variables show expected result and show hints can be set to true to give you some more information about the expected result under the current circumstances and any hints that are available. The code editor on the lower right shows how your solution is used. You can change that code to experiment with different scenarios if you'd like, like if we change this largest number to 33 instead and run Test my code, you can see that now the expected result is 33. Eventually, when you get the correct result, the output will change there as well. So let's get the correct result for this example. You can see, in this case, all available tests have passed and we get the message that we did it and the result is correct. Regardless of whether your answer is correct, you'll see messages in that console and if any messages are too long to fit, you can scroll sideways to see all the text. When you finished each code challenge, return to the course's table of contents, and click the next video to see my solution.

Contents