0
0
Javascriptprogramming~10 mins

What is JavaScript - Interactive Quiz & Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to display a message in the browser console.

Javascript
console.[1]('Hello, JavaScript!');
Drag options to blanks, or click blank then click option'
Awrite
Blog
Cprint
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using console.print or console.write which do not exist.
Trying to use alert instead of console.log.
2fill in blank
medium

Complete the code to declare a variable named name with the value 'Alice'.

Javascript
let [1] = 'Alice';
Drag options to blanks, or click blank then click option'
Aname
Blet
Cconst
Dvar
Attempts:
3 left
💡 Hint
Common Mistakes
Putting 'var' or 'let' in the blank instead of the variable name.
Using a number or string instead of a variable name.
3fill in blank
hard

Fix the error in the code to correctly add two numbers and store the result.

Javascript
let sum = 5 [1] 3;
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus or multiplication instead of addition.
Leaving the operator blank.
4fill in blank
hard

Fill both blanks to create an object with a property and access its value.

Javascript
const person = { [1]: 'Bob' };
console.log(person.[2]);
Drag options to blanks, or click blank then click option'
Aname
Bage
Dheight
Attempts:
3 left
💡 Hint
Common Mistakes
Using different property names for key and access.
Using properties that are not defined.
5fill in blank
hard

Fill all three blanks to create a function that returns the square of a number.

Javascript
function [1]([2]) {
  return [2] [3] [2];
}
Drag options to blanks, or click blank then click option'
Asquare
Bnum
C*
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Using different variable names inside the function.