Silly story generator complete JavaScript code

// 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

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

const insertX = [‘Willy the Goblin’, ‘Big Daddy’, ‘Father Christmas’];
const insertY = [‘the soup kitchen’, ‘Disneyland’, ‘the White House’];
const 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;

if (customName.value !== ‘’) {
let name = customName.value;
newStory = newStory.replace(‘Bob’, name);

}

if (document.getElementById(“uk”).checked) {
let weight = Math.round(300 * 0.0714285714);
let temperature = Math.round((94 - 32) * (5 / 9));
newStory = newStory.replace(‘300 pounds’, ${weight} stone);
newStory = newStory.replace(‘94 fahrenheit’, ${temperature} centigrade);
}

newStory = newStory.replace(/:insertx:/g, randomValueFromArray(insertX));
newStory = newStory.replace(’:inserty:’, randomValueFromArray(insertY));
newStory = newStory.replace(’:insertz:’, randomValueFromArray(insertZ));

story.textContent = newStory;
story.style.visibility = ‘visible’;
}

Hi @https.www.this !

Can you put your code into an online editor like JSFiddle or Codepen, as instructed on the assessment page? It is a lot easier for me to assess it if I cna click straight through to it.