-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
28 lines (26 loc) · 2.29 KB
/
script.js
File metadata and controls
28 lines (26 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const funFacts = [
"A teaspoon of honey is the life's work of 12 bees.",
"The shortest war in history was between Britain and Zanzibar on August 27, 1896. It lasted 38 to 45 minutes.",
"Octopuses can change the color and texture of their skin to blend in with their surroundings within seconds.",
"There are more stars in the universe than grains of sand on all the Earth's beaches.",
"Bananas naturally contain radiation due to their potassium-40 content, but they are completely safe to eat.",
"Sloths can hold their breath longer than dolphins. They can slow their heart rate and stay underwater for up to 40 minutes.",
"The longest-living land animal is a tortoise named Jonathan, who was born in 1832 and still lives today.",
"The average cloud weighs about a million pounds, yet it stays afloat because the water droplets are spread out over a large area.",
"Ants can carry objects up to 50 times their body weight due to their incredibly strong muscles and exoskeletons.",
"The first oranges weren’t orange—they were originally green. The fruit was first cultivated in Southeast Asia, where they still grow green.",
"The smell of freshly cut grass is actually a plant distress signal, as the grass releases chemicals when injured.",
"Sea otters hold hands while they sleep to keep from drifting apart in the water.",
"Butterflies taste with their feet because they have taste sensors on their legs.",
"A blue whale’s heart weighs as much as a small car and can be heard beating from over two miles away.",
"Cows have almost 360-degree vision because their eyes are located on the sides of their heads.",
"The word ‘nerd’ was first coined by Dr. Seuss in his book ‘If I Ran the Zoo’ in 1950.",
"The dot over the lowercase letters 'i' and 'j' is called a 'tittle.'",
"There’s an island in Japan called Okunoshima that is home to hundreds of friendly, free-roaming rabbits.",
"A jellyfish is about 95% water and has no brain, heart, or bones.",
"There is a species of lizard called the basilisk lizard that can run on water, earning it the nickname ‘Jesus Christ lizard.’"
];
function generateFact() {
let randomIndex = Math.floor(Math.random() * funFacts.length);
document.getElementById("fact").innerText = funFacts[randomIndex];
}