-1
所以我有一些函數,它返回新的Object()裏面的數據。如何從返回的對象中獲取數據?
事情是這樣的:
function foo() {
...
let arr = ['one', 'two', 'three'];
return new Bar(arr);
}
的console.log表明這一點:
Bar { 'one', 'two', 'three' }
我怎樣才能把他們救出來? 例如,設置可變首先看重>「一」
更新:這裏就是我想:https://github.com/sindresorhus/get-urls
它取決於'Bar'類提供的API。 – Barmar
你對Bar的定義在哪裏? –
很難相信這就是你在控制檯看到的結果 – charlietfl