Image

Imagekritikal wrote in Imagejavascript

where's the undefined coming from?

Where is the "undefined" in the alert coming from?

var propval;
var contactList = [{"name":"foo","locaction":"bar"}];

for (prop in contactList[0]) {

propval += prop + "=" + contactList[0][prop] + "\n";

}alert(propval);