Assessment wanted for Silly Story Generator?

Can I please get an assessment for the Silly Story Generator🥺
Below is the link to my code
Silly Story Generator Code

Thanks in advance🙂

Hello @Olixpin

why you sad ?! you doing great well done just some notice here

  1. you created a function randomValueFromArray inside result() while it valid code but you use that way only if you do not want that internal function to be accessible from outside the external one

  2. i see you define storyText inside the result function so you do not need to define new variable newStory as storyText we be reset each time when you click the button

  3. for replacing insertx: you can call replace twice or use replaceALL which replace all the occurrence of insertx

and here some chocolate so you do not be sad

and have a nice day :slight_smile:

1 Like

Aww. Actually, I was so sure that the code I wrote had some lapses even if it run properly, the reason being a little bit sad lol, but with the chocolate, I am happy now :smiling_face_with_three_hearts:. Thank you!

For the code, I have made adjustments and you can take a look.
Here is the link to the code:

Thank you in advance!

2 Likes

glad to see you happy @Olixpin

this is much better

by the way since storyText and insertX/y/z are constant would not it be better to define them as const not as let :wink:

and you welcome :slight_smile:

1 Like

Yeah that is true🤗
would definitely correct that. How I wish I can write a perfect code😐

less I forget, thank you so much for the feedback! I love you😘

1 Like

that very hard to answer but what i do

  1. i solve the problem first then think is there better way to do it or not then try to improve it

  2. check other people code let me know many ways to solve the same thing despite if their code are better than mine or the opposite i still see new ways maybe that other way help me in other case when my way is not possible

  3. use simple way to solve the issue by split it to small issue till it be so easy to solve it

  4. always keep learning and never think that you got it all and even the most famous and experience one make some mistake cause we are human

  5. learn from your mistake

you very welcome and thanks for that love i do not deserve it and thanks a lot and have a nice day :slight_smile:

1 Like

Thank you so much for the helpful advice! I am grateful.

2 Likes

@Olixpin you very welcome and glad to help :slight_smile: