javascript - Assign attributes to values in array js/jquery -


In my script, a function uses values ​​in my teststim array.

  var teststim and I want to attribute these values ​​to, so that the attributes "A", B ("A", "A", "B", "C" ]  

"birthday", ...

I need to find a way to access these features. I thought about something like this: {Content: "n"}, {content: "b", attribute: "birthday"}, {content: "c", specialty: "Whatever"}

may be closer than I am thinking But I'm not able to access the 'attribute' values ​​according to the content values. What am I missing?

You need an array of objects:

  var teststim = [{content: "a", attribute: "name"}, {content: "b", attribute: {Var obj = teststim [i] for "birthday"}, {content: "c", attribute: "whatever"}]; (var i = 0; i & lt; teststim.length; i ++); If (obj.content == 'C') {Warning (obj.attribute); // "whatever"};};  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -