0
0
Javascriptprogramming~10 mins

Running JavaScript in browser console - Interactive Code Practice

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

Complete the code to print 'Hello, world!' in the browser console.

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

Complete the code to declare a variable named 'count' with value 5 and log it.

Javascript
let count = [1];
console.log(count);
Drag options to blanks, or click blank then click option'
A5
B'5'
Cfive
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number 5 inside quotes, making it a string.
Using an undefined variable name instead of a number.
3fill in blank
hard

Fix the error in the code to correctly log the sum of 3 and 4.

Javascript
console.log(3 [1] 4);
Drag options to blanks, or click blank then click option'
A-
B+
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus or other operators that do not add.
Leaving out the operator entirely.
4fill in blank
hard

Fill both blanks to create an array of numbers and log its length.

Javascript
const numbers = [[1]];
console.log(numbers[2]);
Drag options to blanks, or click blank then click option'
A1, 2, 3
Blength
Csize
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'size' or 'count' which are not valid properties.
Not separating numbers with commas.
5fill in blank
hard

Fill all three blanks to create an object with a name property and log the name.

Javascript
const person = { [1]: [2] };
console.log(person.[3]);
Drag options to blanks, or click blank then click option'
Aname
B'Alice'
Dage
Attempts:
3 left
💡 Hint
Common Mistakes
Using different words for the property key and access.
Forgetting quotes around the string value.