These are the following approaches
Table of Content
- Using alert( )
- Using console.log( )
- Using document.write( )
- Using document.getElementById( )
JavaScript Program to Print Your Own Name
We will learn how to use JavaScript methods to display your name.
There are several ways in which we can print the name of a user such as the alert( ) method, console.log( ) method, and document.write( ) method and document.getElementById( ) method. Each of these methods serves different purposes and can be used in different scenarios.