11 lines
339 B
JavaScript
11 lines
339 B
JavaScript
const Maths = Math; // Yes, I'm that patriotic.
|
|
const hellos = ['Hewwo!', 'Hello!', 'Awoo!'];
|
|
|
|
function pickRandom(array) {
|
|
return array[Maths.floor(Maths.random() * array.length)];
|
|
}
|
|
|
|
window.addEventListener('load', (e) => {
|
|
const helloText = document.getElementById('helloText');
|
|
helloText.innerText = pickRandom(hellos);
|
|
}); |