PierreLyons / fcc-quoteMachine

A simple site which displays a random quote when a button is clicked. Built as a FreeCodeCamp exercise.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

quoteMachine

This repository will contain all files related to the creation of the random quote machine, which is an exercise in the FreeCodeCamp curriculum.

An explantion of the javascript that generates the randopm quotes:

A javascript object contains a series of properties (1...n) each with two sub-properties ("quote" and "author"). When the button is clicked, a random value between 1 and n is generated, then checked to ensure it is different from the last generated value. If it is not different, it is re-generated and re-checked until it is different. This value is used to access the sub-property values ("quote" and "author") of the property identified by the randomly generated value. The sub-property values are then assigned to the appropriate HTML elements.

About

A simple site which displays a random quote when a button is clicked. Built as a FreeCodeCamp exercise.


Languages

Language:HTML 41.6%Language:CSS 30.0%Language:JavaScript 28.4%