Console
In JavaScript, we use console.log()
to write a message (the content of a variable, a given string, etc.) in console
. It is mainly used for debugging purposes, ideally to leave a trace of the content of variables during the execution of a program.
Example:
console.log("Welcome to Learn JavaScript Beginners Edition");
let age = 30;
console.log(age);
๐ Tasks:
- [ ] Write a program to print
Hello World
on the console. Feel free to try other things as well! - [ ] Write a program to print variables to the
console
.- Declare a variable
animal
and assign the dragon value to it. - Print the
animal
variable to theconsole
.
- Declare a variable