728x90
728x90

most Javascript systems (including node js) provide a console.log function that writes out its arguments to some text output device. In browsers, the output lands in the JavaScript console.

The console.log function is a useful tool for debugging and understanding how your code is executing. You can use it to output the values of variables and objects, as well as to print messages to the console.

It's important to note that console.log should not be left in your production code, as it can slow down performance and may reveal sensitive information to users.

though building names cannot contain period characters, console.log does have one. This is because console.log isn’t a simple binding. it is actually an expression that retrieves the log property from the value held by the console binding.

This part of the browser interface is hidden by default, but most browsers open it when you press F12 or a command-option-I

\if that does not work, i think you got some another os, search in net.


The console.log function can also take multiple arguments, which will be printed out in a space-separated list.

For example,

 console.log('The answer is', 42)

this would output The answer is 42. You can also use string substitution to include values dynamically in your log messages, using %s as a placeholder for a string and %d for a number.

For example,

console.log(console.log('Hello, %s! You are visitor number %d.', 'ramona', 816)

would output Hello, Ramona! You are visitor number 816.

It's worth noting that console.log is not the only function available on the console object. Other useful functions include console.error for logging errors, console.warn for logging warnings, and console.info for logging information. Additionally, you can use console.table to output data in a tabular format, which can be useful for visualizing complex data structures.

300x250

'2023 공부한것들' 카테고리의 다른 글

[node js] npm  (0) 2023.06.18
[TIL] 20230618 : what's your name?  (0) 2023.06.18
[TIL] 20230617 : killing my ocd  (0) 2023.06.17
[node.js] call stack (eng)  (0) 2023.06.17
[TIL] 20230615 개발일지  (0) 2023.06.16

+ Recent posts