var fs =require('fs');
var contents=fs.readFileSync('./emailsender.json');
var jsoncontent=JSON.parse(contents);
console.log(jsoncontent["to"]);
emailsender.json
[{"to":"kshitiz@zillion.io","from":"kshitiz@zillion.io"},{"to":"kshitiz.orizion@gmail.com","from":"kshitiz.orizion@gmail.com"}]
答案 0 :(得分:1)
console.log(jsoncontent[0].to)
jsoncontent
是一个对象数组。