Pregunta de entrevista de Elastic

How to flatten a nested JS object into an object keys in dot notation.