This log function takes in string parameters which we can use to output values onto the console of the web browser.
Let's see in an example.
To open the console window, right click on the web page and click on "Inspect". Then click on the "Console" tab to open the console window.
In this method, we use the Window object to notify and display values to the user.
The Window.alert() method also takes a string as a parameter to the method and you can pass in any value as a string to display to the user web page.
Different browsers have different ways to display the alert box too.
Let's see this in an example.
Let's see this in a example.