Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  151] [ 1]  / answers: 1 / hits: 41082  / 14 Years ago, mon, october 11, 2010, 12:00:00

In node.js you can use console.log or sys.puts to print out to the screen.



What is the preferred method and what is the difference between these?


More From » console

 Answers
13

sys.puts simply prints the given string in the logs.



But if you want to print a more complex object (Array, JSON, JSObject) you have to use console.log because you want to look inside of the object.



sys.puts would give you only [object object] for example.


[#95365] Thursday, October 7, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dewayneh

Total Points: 538
Total Questions: 114
Total Answers: 97

Location: Liberia
Member since Fri, Oct 22, 2021
3 Years ago
;