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?
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?
The preferred method is console.log(). sys.puts() has been removed.
The sys module was renamed util with this commit dated Oct 12, 2010. So sys.puts() became util.puts(). util.puts() was added in v0.3.0, deprecation since v0.11.3, and removed in v12.0.0. The documentation advises to use console.log() instead.