Working with arrays [closed]

-3

I have this array:

{tag: "teste"}

How do I save the word test in a variable?

    
asked by anonymous 11.12.2018 / 18:57

1 answer

1

This {tag: "teste"} is a json object, not an array. If you get an object named xpto with this value, then just look for the field name: var a = xpto.tag . Hugs and follow the leader.

    
11.12.2018 / 19:07