Tech Study

JavaScript console.log()

console.log is a JavaScript method used to log or print messages to the JavaScript console. It is primarily used for debugging purposes, allowing developers to see the values ​​produced by different steps in their code.
The following is an example using the console.log:

console.log("Hello!");

When this code is run in the browser, the message “Hello, World!” is displayed. It is printed to the browser’s JavaScript console. You can access the JavaScript console in most browsers by pressing F12 and selecting the “Console” tab.
In some browsers, you can also access the console by right-clicking on the page and selecting “Inspect Element”.
You can also use console.log to log variable values. Example:

const x = 30;
console log(x);

Prints the value of x to the console. In this case it is 30.
Console.log can also take multiple arguments separated by spaces when printed to the console. Example:

const name = "Mohan";
const age = 28;
console.log(name, age);

“Mohan 28” is printed to the console.
In addition to console.log, you can use other methods that may be useful for debugging, such as console in the JavaScript console.warning and console.error. These methods write messages to the console, but use different visual indicators to help differentiate between different types of messages.

 

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more