我有以下由 DocuSign API 生成的數組:const signers = [ exports { email: '[email protected]', name: 'Test Name One', recipientId: 'signer_1', routingOrder: '1' }, exports { email: '[email protected]', name: 'Test Name Two', recipientId: 'signer_2', routingOrder: '2' }, exports { email: '[email protected]', name: 'Test Name Three', recipientId: 'signer_3', routingOrder: '3' }]我需要在此數組中獲取對象的索引,其中 recipientId === 'signer_2' (例如),并嘗試了以下操作:const signerKey = signers.filter(signerObj => { console.log(signerObj) // returns "exports { ...email, name, etc }" console.log(Object.keys[signerObj]) // returns undefined console.log(signerObj.exports.recipientId) // returns undefined console.log(typeof signerObj) // returns object return signerObj.recipientId === 'signer_2' // returns undefined})exports由于它們不是實際對象,我該如何處理在其中查找數據?
如何獲取導出數組的值
大話西游666
2022-10-27 10:44:15