I want to save a value as a pair of keys and values ββin javascript
So far i'm doing it like
var list_of_addressbook_entries = {}; list_of_addressbook_entries.guest_name = name ; for(key in list_of_addressbook_entries) { alert("key " + key + " has value " + list_of_addressbook_entries[key]); }
In the above code, guest_name is a variable whose value comes from onclick
therefore, when I do the above, it shows me the result as
key guest_name has value M
it does not print the value of guest_name
I need a result like
key guest_name_variable value has key M
Please suggest me what to do here?
source share