I did this several times. For example, when I built a Web App that gets the recipe from outside API and serves it on the Web Page depend on Visitor choose Forkify or when I built Web Page wich striped exponential to multiply shape and to adding shape STRIP EXPOTENTIAL. But this time I look closer at some tricky parts of this task.
HTML button placing that reload your page, or not.
When you build an HTML form probably you put a button in
marks. This is something normal when you want to send data to the server, or to another Web Page. But this is something, that was made my first real problem in a task that I did.
Of course, you can deal with this using localStorage or GET mechanism, but when you want to make all jobs on one static page, you need to put the button out of the HMTL form construct.
I’m not sure why that simple way to grab and pass variables to function won’t worked. Perhaps this isn’t a good way because of Scope behavior. I didn’t find an answer to this question, but I found the solution.
Why we all sometimes stuck on simple tasks?
This task showed me, that no matter how long you codding, how good you know some programming language, for all of us there will be a task, that takes you a lot of time, much more than you expect. After all, you set with coffee and asked yourself: why it took me so long. I made much more complicated code in a shorter time ?