Hello there.
I checked your code and I found 2 problems in it:
First your constant variables insertX, insertY and insertZ should be array but yours is a template literal(string).
Second when you want to replace your x ,y ,z Items you’ve been suggested to use string methods(The 3 last lines in your code) not assignment.
So I review your code and html file of MDN, and its seems like you have changed some code in storyText constant. In MDN html file it write :insertX: and you have changed it to ${insertX}. I guess your error in number 2 is for this.
You have used the string method replaceAll(). That’s good but you didn’t used it properly. I suggest to read the reference about replaceAll() method and try again.
By the way assignment in JavaScript is this ( = ) sign.
When you write code its good to have some plans and steps to do but you need to put them in right place. Your step 4 is totally useless cause it is OUTSIDE of the result function so when you call the function there are some missing parts.
The replace method returns a NEW string so when you use this method, you should save it in a variable unlike yours.
I mentioned this method a lot in past replies as well but it seems like you didn’t read the documentation of it. I put a link down below, i hope you study it.
By the way, there are 2 :insertX: in the text, you better use replaceAll method for that. Also I recommend to read about variable hoisting. I found an error for that in your code as well.
I post a link down below that is my code when I was studying like you I wrote it. You might wanna check it out: