Alternative solution with map for Chapter 12 Exercise (part 3)-JS

I’ve completed chapter 12 (Objects & Math) parts 1 and 2, however I’m struggling with part 3. The solution provided uses a while loop, and I’m not totally grasping what happening line by line. Also wouldn’t using map be more effective? … HELP!