Skip to Content

JavaScript Practice: Data Types, Conditional, Functions

Practice JavaScript conditionals and functions with these 3 code challenges.

In these exercises, you will practice creating JavaScript functions. This is helpful if you want to improve your logical thought process and practice creating functions with proper JavaScript syntax.

Some of these challenges are difficult! Take some time to think about them before starting to code.

You might not get the solution correct on your first try — look at your output, try to find where you’re going wrong, and iterate on your solution.

Finally, if you get stuck, use our solution code! If you “Check Answer” twice with an incorrect solution, you should see an option to get our solution code. However, truly investigate that solution — experiment and play with the solution code until you have a good grasp of how it is working. Good luck!