HELP plz regarding MDN JavaScript 'Silly story generator'

I tried for the past 6 hours solving this and could not get it to work at all.Would highly appreciate your help :slight_smile:

Here is the code

Hello @code-hunter

you doing good just many typo

for example

 newstory.replace(insertY,yItem);      it should be newStory s is capital 
 newStory.repalce(insertZ,zITem);    should be replace not repalce and zItem not z ITem

should be

 newStory.replace(insertY,yItem);
 newStory.replace(insertZ,zItem);

another issue

let xItem = randomValueFromArray();

the randomValueFromArray() take one parameter of type array which you should provide so it would be like that

let xItem = randomValueFromArray(insertX);

one more thing that newStory is string so it the replace function does not modify it . it just return a new string with the new value

so you should use newStory = newStory.replace

also notice that :insertx: exist twice in the string so you can use replace twice or use replaceAll

check this for more details about replaceAll

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll

you need to do some modification here

 if(document.getElementById("uk").checked) {
            let weight = Math.round(300 * 0.0714286) + ' stone';
            let temperature =  Math.round((94-32)*5/9) + ' centigrade';
            temperature.replace('94 Fahrenheit', temperature);
            weight.replace('300 pounds',weight);
        
          }

hope that help and have a nice day :slight_smile:

another point that would save you from many typo that you use IDE or any editor it would help to spot it and it would give you autocomplete and speed your coding