const x = diff.map(key => {
if (key.status === 'removed') {
return `- ${key.key}: ${key.value}`;
} else if (key.status === 'new') {
return `+ ${key.key}: ${key.value}`;
} else if (key.status === 'same') {
return ` ${key.key}: ${key.value}`;
} else if (key.status === 'changed') {
return `- ${key.key}: ${key.value.oldValue}\n+ ${key.key}: ${key.value.newValue}`;
}
});
for (const key of x) { console.log(key); }