When using a browser, you can use a print out function and results called “console.log”.
After that, you need to use a <head> tag. Inside head tag, you have to use a <script> tag. It’s not always required a <script> tag inside <head> tag.
- Print in HTML Tag
- Use Alert box
- Pring in Console
Output: A launched in browser, you can see the output.
This is also easy just to use an alert() function with a message. An alert box used for giving acknowledgment to the user.
Output: A pop will come on the browser window with a message and close button.
console.log()method, also print a string. This is important when you required to see the application log at the development phase.
Output: You have to open inception element -> console, to see the output in the browser.
OS: macOS 10.14 Mojave
Version: HECMAScript 2018