How to build your own headline generator
Try this out
Now to decode it
1. This may look like gibberish but see how the nouns, scandals and reasons are laid out like [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’ ].
2. Then, they are randomly shuffled up.
3. Finally, the code places the randomly shuffled randNoun, randScandal and randReason in sequence into the page to create the final headline.
Make sure to wrap the above in HTML script tags To make the headline and button centered in the page, we style each of their containers (one called container, one called wrap) by using some simple CSS.
Got a better/cleaner/faster way to code a headline generator? Tell us!