Hello I need help for assessment silly story generator thank

Im trying to complete the result() funtion part I stuck if someone can explain it thank you

Hello @crince_ebelempou

could you share your code and the link to the task

and have a nice day

//1. COMPLETE VARIABLE AND FUNCTION DEFINITIONS

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];
}

/2. RAW TEXT STRINGS/

var 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:. ‘:’ saw the whole thing, but was not surprised — :insertx: weighs 300 pounds, and it was a hot day.’
var insertX = [“Willythe Goblin”, “Big Daddy”, “Father Christmas”];
var insertY = [“the soup kitchen”, “Disneyland”, “the White House”];
var insertZ = [“spontaneously combusted”, “melted into a puddle on the sidewalk”,“turned into a slug and crawled away”];

//3. EVENT LISTENER AND PARTIAL FUNCTION DEFINITION

randomize.addEventListener(‘click’, result);

function result() {
let newStory = storyText;
let xItem = randomValueFromArray(array);
let yItem = randomValueFromArray(array);
let zItem = randomValueFromArray(array);

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’;
}

first i would be better to share in any sharing service espcially one the has live preview

this would not work as there no variable called array you should replace it insertX insertY insertZ
you should define the newStory outside the function so you can access it later

in this line you set the textContent to the story to what?

alway use the browser console tool
right click on the page then inspect then console it will show you the errors there and also use console.log to check if the a variable or method work as it should be or not

hope that help and have a nice day

thank you so much for yout help

you very welcome and let me know if i can help with anything else and have a nice day