Introduction
Welcome to the Javascript Primer Quiz! This quiz is designed to help with some basics. Your results are not saved, or assessed - this is just a tool to solidify your learning. Remember to review the Handbook's JavaScript Primer
info if you get stuck.
How the quiz works
- The quiz is split up into different thematic sections, with each section having a few code exercises to complete.
- Each question has a code box where you type your answer. Most are prepopulated with
let answer
, which is an empty variable container. You need to add your answer (which will be a numeral) by assigning it to theanswer
variable e.g.let answer = 4
. - Beneath the code box is a test(s) which starts out red. Once the testing criteria has been met (i.e. the correct answer has been entered), the test will turn green. If you put in an answer and the test(s) stay red, something's not yet right, keep trying!
- Once all tests for a particular section are green, move on to the next section!

A warmup exercise
How many vegetables are in the list below?
- Strawberries
- Potatoes
- Cauliflower
- Bananas
let answer
tests({
'answer is correct': (t) => {
t.isEqual(answer, 2, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
}
})
Let's get into it
Start with section 1 (Numbers) and work your way through them sequentially.