if (!Object.keys) Object.keys = function (o) {
if (o !== Object(o))
throw new TypeError('Object.keys called on a non-object');
var k = [], p;
for (p in o) if (Object.prototype.hasOwnProperty.call(o, p)) k.push(p);
return k;
}
var myObj = {key1: "value1", key2: "value2", key3: "value3"};
var result = [], i;
var keys = Object.keys(myObj);
for (i = 0; i < keys.length; i++) {
result.push(keys[i] + ":" + myObj[keys[i]]);
}
alert(result);
вариант