function printKeys(object) {
for (const [ key, value ] of Object.entries(object)) {
if (value?.constructor.name === 'Object') {
printKeys(value);
} else console.log(key, value);
}
}
function printKeys(object, prefix = '') {
for (const [ key, value ] of Object.entries(object)) {
if (value?.constructor.name === 'Object') {
printKeys(value, `${prefix}${key}.`);
} else console.log(prefix + key, value);
}
}