Apple Interview Question

How to transform values in a JavaScript array