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 Worldon the console. Feel free to try other things as well! - [ ] Write a program to print variables to the
console.- Declare a variable
animaland assign the dragon value to it. - Print the
animalvariable to theconsole.
- Declare a variable