Elastic interview question

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