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
  • 13,750
  • 13
  • 62
  • 153

1 Answers1

1

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

AbhinavD
  • 5,934
  • 3
  • 25
  • 38