Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the output modes of JavaScript

Shulou Source: shulou.com Published: 2022-06-02 11:24:13 09月23日 Update

This article mainly introduces "what are the output methods of JavaScript". In daily operation, I believe many people have doubts about what are the output methods of JavaScript. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "what are the output methods of JavaScript"! Next, please follow the small series to learn together!

There are three output modes of JavaScript: 1, pop-up warning box for output, syntax "alert(" output information ")";2, console output, syntax "console.log(" output information ")";3, browser visible area output, syntax "[xss_clean](" output information ")".

Operating environment of this tutorial: Windows 7 system, Javascript version 1.8.5, Dell G3 computer.

Three ways of JavaScript output

alert(year) pop-up warning box

Title //define a variable to store a person's age var year = 23; alert(year)

console.log() console output

Title //define a variable to store a person's age var year = 23; console.log(year);

Press F12 for rear console

3. Output [xss_clean]() to the browser visible area

Title //define a variable to store a person's age var year = 23; [xss_clean](year)

At this point, the study of "what are the output methods of JavaScript" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Output mode learning personal information variables age console syntax storage control area more browser help browsing utility next tutorials articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Docker Huawei macOS vpn