Burak Icel

Burak Icel

  • NA
  • 2
  • 585

How to read the value from an object in an array?

Feb 24 2021 11:40 AM
hey everyone, 
 
I have an array where i can't read the values from it.
 
i have:
  1. const interfaces: string = this.transformArray(product.interfaces);  
to see the values i use:
  1. console.log(product.interfaces)  
  2. console.log(interfaces)  
and the console output is for product.interfaces:
  1. [  
  2.   {  
  3.     amount: null,  
  4.     interface: [ [Object] ],  
  5.     __typename: 'interfaces_interface_BlockType'  
  6.   },  
  7.   {  
  8.     amount: null,  
  9.     interface: [ [Object] ],  
  10.     __typename: 'interfaces_interface_BlockType'  
  11.   },  
  12.   {  
  13.     amount: null,  
  14.     interface: [ [Object] ],  
  15.     __typename: 'interfaces_interface_BlockType'  
  16.   },  
  17.   {  
  18.     amount: null,  
  19.     interface: [ [Object] ],  
  20.     __typename: 'interfaces_interface_BlockType'  
  21.   }  
  22. ]  
and for interfaces:
  1. undefined, undefined, undefined, undefined  
 The true value of this array should be sth like "Digital inputs and outputs (24 VDC level)". i guess i have to take the object from the array and read the object but its just guessing...
Can anyone help me pls?
 
Greetings 

Answers (2)