replaced the array.map polyfill with the official version from MDN
Removed trailing commas, added semis where appropriate