In the previous article, we wrote the first program with Console.log, though it was so simple. So I'm going to tell you about the object in node. js.
For people who have studied Java. NET, the Word object should be very kind, and if you don't feel kindly, learn the object-oriented first.
In our programming, everything is the object. You can think of anything as an object.
However, there are objects in node. js, and console is an object. Since it is the object, he should have a public method. As you can see, log is the way it is, seemingly static.
So what are the methods in the console, let's let him output it.
Oh, the console still has so many hidden methods. The console object is mentioned below.
Console is a console object that is provided by node. JS, which contains the function error to standard output (stdout) log, which is output to standard error (STDERR).
Console.log () functions like printf () in other languages, it takes a string and automatically adds a newline character (\ n), and Console.info is its alias. Console.warn is the alias of Console.error.
Console.dir borrowed the Sys module's inspect () method to directly input the object's string representation into the standard output stream.
Console.assert generic debugger, throws a custom exception message if there is a wrong way.
Console.trace () enters the current call stack to the standard error stream.
Console.time and Console.timeend are about time.
If you have nothing to do, you can carry out the above mentioned method again.