Skip to content

Challenges

Short practice challenges you can solve in any order. Every one gives feedback and an explanation.

Showing 24 of 24 challenges

Challenges

  • ProgrammingMultiple choice

    Primitive values

    Tell simple values apart from arrays and objects.

    Beginner2 minValues and types
  • ProgrammingMultiple choice

    The type of a number

    Find out what typeof reports for a whole number.

    Beginner1 minValues and types
  • ProgrammingPredict the output

    Three typeof results

    Predict what typeof reports for three different values.

    Beginner2 minValues and types
  • ProgrammingFill in the blank

    Clean up and shout

    Complete two string methods so the text is trimmed and upper-case.

    Beginner3 minStrings
  • ProgrammingNumeric answer

    Counting characters

    Work out the length of a string.

    Beginner1 minStrings
  • ProgrammingWrite code

    Shout it

    Return a string in capital letters with an exclamation mark.

    Beginner4 minStrings, Functions
  • ProgrammingWrite code

    Your first message

    Print two lines with console.log.

    Beginner3 minStrings, Values and types
  • ProgrammingMultiple choice

    Adding decimals

    Predict a comparison that surprises many beginners.

    Intermediate2 minNumbers, Boolean expressions
  • ProgrammingMultiple choice

    Changing a constant

    Predict what happens when you assign to a const.

    Beginner2 minVariables and scope
  • ProgrammingWrite code

    Greet a guest

    Use a variable inside a printed message.

    Beginner4 minVariables and scope, Strings
  • ProgrammingPredict the output

    Updating a score

    Follow a variable as it changes line by line.

    Beginner2 minVariables and scope, Operators
  • ProgrammingNumeric answer

    Order of operations

    Work out which part of an expression runs first.

    Beginner1 minOperators
  • ProgrammingPredict the output

    Text meets number

    See how + and - treat a string and a number.

    Beginner2 minOperators, Strings
  • ProgrammingNumeric answer

    What is left over

    Use the % operator to find a remainder.

    Beginner1 minOperators, Numbers
  • ProgrammingPredict the output

    Double or triple equals

    Compare == and === on the same values.

    Intermediate3 minBoolean expressions, Operators
  • ProgrammingMultiple choice

    Falsy values

    Which values does if treat as false?

    Intermediate3 minBoolean expressions, Control flow
  • ProgrammingPut in order

    Build a discount

    Put four lines in the order that makes the program work.

    Beginner3 minControl flow, Variables and scope
  • ProgrammingWrite code

    Ticket price

    Choose a price with if and else, and get the boundaries right.

    Beginner6 minControl flow, Functions
  • ProgrammingWrite code

    Add two numbers

    Write a function that returns a sum.

    Beginner4 minFunctions, Numbers
  • ProgrammingWrite code

    Convert a temperature

    Turn a formula into a function.

    Beginner5 minFunctions, Operators
  • ProgrammingDebug

    Fix the average

    A calculation that runs but gives the wrong answer.

    Beginner5 minDebugging, Operators
  • ProgrammingDebug

    Fix the syntax error

    A program that never starts: find the missing piece.

    Beginner4 minDebugging, Functions
  • ProgrammingDebug

    Fix the weekend check

    A condition that can never be true.

    Beginner5 minDebugging, Boolean expressions