YouTip LogoYouTip

Met Console Log

# HTML DOM console.log() Method [![Image 3: Console Object](#) Console Object](#) ## Example Output information to the console: console.log("Hello !"); [Try it Β»](#) * * * ## Definition and Usage The console.log() method is used to output information to the console. This method is helpful for testing during the development process. **Tip:** To test this method, the console must be visible (press F12 in the browser to open the console). * * * ## Syntax console.log(message) * * * ## Browser Support The numbers in the table specify the first browser version that fully supports the method. | Method | | | | | | | --- | --- | --- | --- | --- | --- | | console.log() | Yes | 8.0 | 4.0 | Yes | Yes | * * * ## Parameter Description | Parameter | Type | Description | | --- | --- | --- | | _message_ | String or Object | Required. The message to be displayed on the console. | * * * ## More Examples ## Example Use an object as the output information: var myObj = {name : "", site : "www."}; console.log(myObj); [Try it Β»](#) ## Example Use an array as the output information: var myArr = ["Google", "Taobao", "", "Facebook"]; console.log(myArr); [Try it Β»](#) [![Image 4: Console Object](#) Console Object](#)
← Met Console TraceMet Console Group β†’