JavaScript Challenges

Use the HTML already provided for each challenge. Write your JavaScript in the script area at the bottom of the page.


Challenge 1: Is It In the List?

The user types a word. The program checks whether that word exists in an array.


Challenge 2: Count the Matches

The user types a number. The program counts how many times that number appears in an array.


Challenge 3: Above, Below, or Equal?

The user enters a number. The program sorts the values in an array into three groups: above, below, or equal to that number.


Challenge 4: Guess the Secret Word

Three word choices appear as buttons. One of them is randomly chosen as the secret word. Keep clicking until you find it.


Challenge 5: Roll a 6

Click the button to roll a die. Keep track of how many rolls it takes to get a 6.