いいので、オブジェクトの配列があります。ランダムに生成されたテーブル値で定義されます。私は、オブジェクトの配列を検索し、コードを実行したい場合は、1つのテーブル値例えば。 "table1"は6回以上発生します。ここでJavaScript:特定の値のオブジェクトの配列を検索します。
は、私が持っているオブジェクトの配列です:
var data = [{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
{
name: "",
pref: "",
table: ""
},
];
オブジェクトはすべて実際には同じ値を持っています...あなたに質問がありますか? –
ループを使用して配列を反復することができます。 – brso05
何を試しましたか? –