I was looking for feedback on my Pomodoro timer, so added it as a reply to 'Let’s discuss your “Pomodoro Clock”'
That was 5 days ago, but nothing turned up. Then I realized I should have posted in ‘Project Feedback’ so here it is.
Project Link - https://codepen.io/roygrubb/pen/egNmRz/
I have a couple of general but related questions about parameter passing and functional programming:
General comment: I imitated the sample, as I usually do with FreeCodeCamp exercises, because for me it turns out to be more of a challenge. If I build to my own design, I’ll probably use techniques I know. But if I try to imitate the example FreeCodeCamp gives us, I often have to work harder to find out how it’s done (without looking at the example code, of course).
I’d appreciate feedback on my code.
And I’m looking for comment on how I use an array passed to functions (and often returned with updates) to avoid globals and achieve some of the goals of functional programming. The disadvantage is that readability is affected, as there’s a need for the developer to refer to comments to find out what, e.g., ar is.
Is this an accepted approach? Are there better alternatives? I don’t want functions to change anything it hasn’t been passed in parameters.
All the same, I do change elements in the DOM from within functions, just not variables. As that’s only the UI, I feel that this doesn’t violate the ideas behind functional programming too much. Is that right?
(Reposted - originally was in https://forum.freecodecamp.com/t/lets-discuss-your-pomodoro-clock/6176/118)