0

I suppose node.js allows us to test javascript code outside a browser. I am trying to test this function using node.js.

file print.js

var a = {
    someProperty: 1
}

function printObject(){
    process.stdout.write("hello: ",a);
}

When I try to run the above code as node print.js, nothing gets printed on the console. Why?

Manu Chadha
  • 15,555
  • 19
  • 91
  • 184

1 Answers1

1

You would have to call the function like printObject(). You have just declared the function

AbhinavD
  • 6,892
  • 5
  • 30
  • 40