This JavaScript code generates random proverbs from a collection based on the Bible.
This project consists of a JavaScript script (app.js) that generates random proverbs from a JSON file (proverbs.json) containing wisdom sayings from the Bible. The generateProverbs
function randomly selects a proverb and logs it to the console.
const proverbs = require('./proverbs.json');
const generateProverbs = (arr) => {
const randomIndex = Math.floor(Math.random() * arr.length);
const currentProverb = arr[randomIndex];
console.log(currentProverb);
}
generateProverbs(proverbs);
When you run the code, you might get outputs like these:
A wise son is a father's joy, but a foolish son is his mother's grief.
- Clone this repository to your local machine.
- Make sure you have Node.js installed.
- Open a terminal and navigate to the project folder.
- Run the following command to generate a random proverb:
node app.js
The proverbs used in this application are wisdom sayings from the Bible. Each proverb imparts valuable life lessons and insights on various aspects of life, morality, and character. They serve as a source of guidance and reflection for many individuals.