JavaScript Object Question
Posted
by Frank Neville
on Stack Overflow
See other posts from Stack Overflow
or by Frank Neville
Published on 2010-03-12T15:15:07Z
Indexed on
2010/03/12
15:17 UTC
Read the original article
Hit count: 297
JavaScript
|objects
What I want to do with the fs object is to add multiple "items" to the fs.items property. How can I do this? You can see my attempt below, obviously this does not work.
I am a beginner, go easy on me :)
Thanks...
var fs = {
name:'test',
items:[]
};
fs.items = {
name:'item1',
value:1
};
fs.items = {
name:'item2',
value:2
}
© Stack Overflow or respective owner