是否有可能构造对象的方式返回如下: baseObject.foo; // return a string describing what foo does
baseObject.foo(); // execute the foo function
baseObject.bar; // bar description
baseObject.bar(); // execute bar
更新
的HTML: <div id="slide">
<div>This is one</div>
<div>This is two</div>
<div>This is three</div>
</div>
的JavaScript: var slider = {
div: document.getElementById("slide"),
div
让我先承认我是一个完整的编程和javascript noob,并且事实是我的麻烦来源。 我想从我用json.stringify保存到的文本文件填充大量自定义对象。当我抓住了文件的内容和JSON.parse(他们),我收到以下错误: fs.readFile('/savedcustomobjectarray', function (err, data) {
var customobjecta