gruss Stefan,
ich möchte gerne folgendes array erstellen.
es sieht ganz danach aus, dass Du eine *liste* von "produkt" -*objekten*
haben moechtest.
array-objekte lassen sich in JavaScript nicht nur ueber den [[Array]]-
konstruktor erzeugen - var arr = new Array(obj1, obj2, ..);
- sondern
auch ueber die array-literal-noation: var arr = [obj1, obj2, ..];
-
var obj = {propName: objectOrValue};
ist ein grob skizziertes [object]-
literal.
Wie kann ich so was hinbekommen???
Deine [product]-objekt-liste koennte dann so aussehen:
~~~javascript var productList = [{
productId: "produktSchluessel1",
orderId: "auftragsSchluesselXyz",
date: "12.02.2007", // wie waer's mit: new Date(), ??
cost: 23.12
}, {
productId: "produktSchluessel2",
orderId: "auftragsSchluesselXyz",
date: "13.02.2007",
cost: 45.23
}, {
productId: "produktSchluessel3",
orderId: "auftragsSchluesselAbc",
date: "09.01.2007",
cost: 56.45
}];
so long - peterS. - pseliger@gmx.net
--
»Because objects in JavaScript are so flexible, you will want to think differently about class hierarchies.
Deep hierarchies are inappropriate. Shallow hierarchies are efficient and expressive.« - [Douglas Crockford](http://javascript.crockford.com/)
ie:( fl:) br:> va:( ls:& fo:) rl:| n3;} n4:} ss:} de:µ js:} mo:? zu:]