Yahoo Interview Question

convert data in javascript