Javascript console.log() Method

Introduction

Write to the console:

console.log("Hello world!");

Press F12 on your keyboard to view the message in the console view.

View in separate window

<!DOCTYPE html>
<html>
<body>
<script>

console.log("Hello world!");

</script>//from ww w.j a v  a  2s.com

</body>
</html>

The console.log() method writes a message to the console.


console.log(message);

Parameter Values

Parameter Type Description
message String or Object Required. The message or object to write in the console



PreviousNext

Related