Answers for "object.keys javascript stack overflow"

0

object.keys javascript stack overflow

var obj = {
   key1: 'value1',
   key2: 'value2',
   key3: 'value3',
   key4: 'value4'
};
var keys = [];

for (var k in obj) keys.push(k);

alert("total " + keys.length + " keys: " + keys);
Posted by: Guest on November-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language