Tesla interview question

DOM manipulation , array and object transformation