Indeed Interview Question

How would you do this in javascript?

Indeed Interview Question: How would you do this in javascript? | Glassdoor