Converts primitives and objects (plain or array-like) to a sensible array representation for Node.js and the browser.