How to convert an object to an array of objects in Javascript?

You may be asking why, the answer is actually quite simple. In programming we are not alw…