-1
私は以下のようなオブジェクトを持っています。 propertymixed配列では、私は配列をch_array項目で置き換える配列があります。オブジェクト内の配列項目を置換する
var myObject = {
propertyString: "this is a string",
propertyAnotherString: "this is another string",
propertyMixedArray: [{"item 1"},{ "item 2"}, {"item 3"}],
propertyObject: { someProperty: "and so on..." }
};
ch_array =[{"new val1"},{ "new val 2"}, {"newval3"}];
var myObject = {
propertyString: "this is a string",
propertyAnotherString: "this is another string",
propertyMixedArray: [{"new val1"},{ "new val 2"}, {"newval3"}],
propertyObject: { someProperty: "and so on..." }
};
'myObject.propertyMixedArray = ch_array'? – trincot
シンプル... 'myObject.propertyMixedArray = ch_array;' –
これは適切なJS割り当てではありません – Redu