I am trying to extract both the keys and values from an object in TypeScript. The code I have used only returns the values, without displaying the keys.
Object.keys(data).forEach(key=> {
console.log('keys', data[key]);
});
However, I found that using the following function in JavaScript correctly gives me both the key and value. Can someone assist me in achieving the same outcome in TypeScript?
angular.forEach(data, function (value, column) {
columns.push(column);
values.push(value);
});