JavaScript JavaScript Basics Working With Numbers The Mad Libs Challenge Revisited

Rebecca Palumbo
Rebecca Palumbo
4,517 Points

Used a for loop and array

Just thought I'd post what I did if anyone wanted to see how to do it with a for loop and an array.

Leaders or pros - let me know if there's a better way to do this or if there is anything that is not a best practice. Thanks!

https://w.trhou.se/6m1996wtnm

3 Answers

Rebecca Palumbo
Rebecca Palumbo
4,517 Points

Because we were supposed to let the user know how many questions were left and I used the variable in the for loop to let the user know, which was decreasing.

Piotr Manczak
Piotr Manczak
Front End Web Development Techdegree Student 16,879 Points

I would do it using increasing q but your way is quite interesting. As long as it works it's cool. Very refreshing approach. I have to remember that solution, it may be very useful in the future.