How do I get values in an array of objects in javascript? [closed]

-1

How do I get values from an array of objects and store them in a variable? In this case, I wanted to get the values of id .

Ex: id = 1234,4586

These id s are dynamic data. Ex: an e-commerce site - a user adds a product to the cart, and it generates this new product id

I use a platform called Vtex, which does not accept scripts on the cart page. It has to be everything via Google Tag Manager. Does anyone know how to do this?

    
asked by anonymous 17.09.2014 / 17:24

1 answer

1

Id is an attribute of your object at position 0 (zero) of the array.

var id = teuarray[0].id
    
17.09.2014 / 17:28