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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
sys.putssimply 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.logbecause you want to “look inside” of the object.sys.putswould give you only “[object object]” for example.