getAll(); not showing whole object aand remove function not working

the get all(); function only shows the first email place into and not the second.
when I use remove(); function first email is still there…HELP!!!

var ds=new App.Datastore();
datastore.js:8 running the Datastore function
undefined
ds.add(‘email’,‘sbbc@bhhc.com’);
undefined
ds.add(‘email’,‘mrddg@88.com’);
undefined
ds.getAll();
Object {email: "mrddg@88.com"}email: "mrddg@88.com"proto: Object
ds.remove();
undefined
ds.getAll();
Object {email: "mrddg@88.com"}

oh I think because the “key” has the same name ‘email’…oops!

Right, good that you caught the error. Just to clarify, when you use the same key/property, it overwrites the key’s value. So the key ‘email’ retains but ‘sbbc@bhhc.com’ has been overwritten with ‘mrddg@88.com’.

As for the remove function not working, you didn’t specify a key to remove so it didn’t remove anything. Had you did ds.remove(‘email’), then it would’ve removed that entry so that you would just be left with an empty object if you were to run ds.getAll() afterwards… Object {}.