我有以下 javascript:
#!/usr/bin/env node
var fs = require(’fs’);
var outfile = "hello.txt";
var out = "Modify this script to write out something different.\n";
fs.writeFileSync(outfile, out);
console.log("Script: " + __filename + "\nWrote: " + out + "To: " + outfile);
在执行以下命令时:
node test.js
cat hello.txt
我得到以下输出:
[object Object]
我究竟做错了什么?