0

我像这样实例化一个对象:(当我说数组时,我的意思是说对象)

text_object = new SText( form_elements );

为了调试,我这样称呼它:

console.log('text_array in caller' + ( text_object.getArray().toSource() ) );

实际功能如下所示:

SText.prototype.getArray = function( ) {
    console.log('text_array in getArray' + this.text_array.toSource() );
    return this.text_array;
};

console.log 在实际函数中显示了数组,但从未返回:这是日志:

[15:16:44.160] text_array in getArray({url:"http://a.com", title:"a", tag:"a", domain:"a.com", path:"http://www.google.com/s2/favicons?domain=a.com"})

[15:16:44.162] text_array in Caller({})
4

1 回答 1

1

你有没有尝试过

console.log('text_array in caller' + text_object.getArray().toSource());
于 2012-07-04T19:21:47.513 回答