Birdeye Interview Question

Flatten an object in js