const data = { en: { text: "this text", title: "this title", person: { tale:"22cm", weight:"3kg", } } } const keyify = (obj, prefix = '') => Object.keys(obj).reduce((res, el) => { if( Array.isArray(obj[el]) ) { return res; } else if( typeof obj[el] === 'object' && obj[el] !== null ) { return [...res, ...keyify(obj[el], prefix + el + '.')]; } return [...res, prefix + el]; }, []); const output = keyify(data); console.log(output);