I am running a code that loops 7 times and I have made it to console.log the user input for every loop. I want to put each console.log output into an array. how do I go about doing this?
the following is my output
Debugger attached.
The Itsy Bitsy Aardvark
Please choose an animal name :
a)aardvark
b)hippo
c)duck
d)pelican
e)t-rex
Enter choice (a-e): a
[ ‘aardvark’ ] - output 1
Please choose an action word ending in ‘ed’ :
a)jumped
b)flipped
c)looked
d)added
e)squashed
Enter choice (a-e): a
[ ‘jumped’ ] - output 2
Please choose an adjective :
a)impressive
b)slimy
c)silly
d)frozen
e)magical
Enter choice (a-e): a
[ ‘impressive’ ] - output 3
Please choose another action word ending in ‘ed’ :
a)exploded
b)scattered
c)flapped
d)snooped
e)poked
Enter choice (a-e): a
[ ‘exploded’ ] - output 4
Please choose a noun :
a)president
b)pastry chef
c)karate
d)beer mug
e)tank
Enter choice (a-e): a
[ ‘president’ ] - output 5
Please choose another action word ending in ‘ed’ :
a)messed
b)smacked
c)tripped
d)danced
e)slurped
Enter choice (a-e): a
[ ‘messed’ ] - output 6
Please choose an adverb :
a)dreadfully
b)happily
c)stupidly
d)awkwardly
e)beautifully
Enter choice (a-e): a
[ ‘dreadfully’ ] - output 7
I want to be able to get all the outputs 1-7 into an array. how do i go about this? Thank you in anticipation.
When you print the value you can also store it into an array, just add a line near the console log that does that with the value printed by the console log