Hello! Please, I need some help I am at the point in the instructions:
Silly Story Instructions ( Create three new variables called xItem
, yItem
, and zItem
,)
I do not know where to insert this. I am lost at this point. This is what I have thus far:
const customName = document.getElementById(‘customname’);
const randomize = document.querySelector(’.randomize’);
const story = document.querySelector(’.story’);
function randomValueFromArray(array) {
const random = Math.floor(Math.random() * array.length);
return array[random];
}
let storyText = “It was 94 fahrenheit outside, so :insertx: went for a walk. When they got to :inserty:, they stared in horror for a few moments, then :insertz:. Bob saw the whole thing, but was not surprised — :insertx: weighs 300 pounds, and it was a hot day.”
let insertX = “Willy the Whale Big Daddy Father Christmas”
let insertY = “the soup kithcen Disney Land White house”
let insertZ = “spontaneously combusted melted into a puddle on the sidewalk turned into a slug and crawled away”
randomize.addEventListener(‘click’, result);
function result() {
let newStory = storyText;
let xItem = randomValueFromArray()
let yItem = randomValueFromArray()
let zItem = randomValueFromArray()
if (customName.value !== '') {
let name = customName.value;
}
if (document.getElementById("uk").checked) {
let weight = Math.round(300);
let temperature = Math.round(94);
}
story.textContent = ;
story.style.visibility = 'visible';
}