Javascript Flatten Array Into Object Oriented Programming Interview Questions