0
0
Node.jsframework~10 mins

Console methods beyond log in Node.js - 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 an error message using the console.

Node.js
console.[1]('This is an error message');
Drag options to blanks, or click blank then click option'
Ainfo
Bwarn
Cdebug
Derror
Attempts:
3 left
💡 Hint
Common Mistakes
Using console.log instead of console.error
Using console.warn which is for warnings, not errors
2fill in blank
medium

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

Node.js
console.[1]('This is a warning!');
Drag options to blanks, or click blank then click option'
Aerror
Binfo
Cwarn
Dtrace
Attempts:
3 left
💡 Hint
Common Mistakes
Using console.error instead of console.warn
Using console.log which is generic
3fill in blank
hard

Fix the error in the code to print a stack trace of the current point.

Node.js
console.[1]();
Drag options to blanks, or click blank then click option'
Atrace
Blog
Cdebug
Dstack
Attempts:
3 left
💡 Hint
Common Mistakes
Using console.stack which does not exist
Using console.debug which is for debug messages
4fill in blank
hard

Fill both blanks to group console messages and end the group.

Node.js
console.[1]('Start Group');
console.log('Inside group');
console.[2]();
Drag options to blanks, or click blank then click option'
Agroup
BgroupEnd
CgroupCollapsed
DgroupClose
Attempts:
3 left
💡 Hint
Common Mistakes
Using groupCollapsed instead of group to start
Using groupClose which is not a valid method
5fill in blank
hard

Fill all three blanks to count how many times a label is logged and then reset the count.

Node.js
console.[1]('myLabel');
console.[2]('myLabel');
console.[3]('myLabel');
Drag options to blanks, or click blank then click option'
Acount
BcountReset
Clog
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using log instead of count
Not resetting the count with countReset