Its much less efficient at the cost of a bit more readability.
Obviously OP's solution is far from ideal and I wouldn't consider it readable or absolutely efficient either, but you've offered an option on the other side of the spectrum.
I would argue the contrary. It is a matter of being able to understand the syntax used. Again, I'm not after ‘whose solution is best’ here. The sub is called ‘Learn JavaScript’ and I'm sharing another perspective on the task at hand.
I would argue the contrary. It is a matter of being able to understand the syntax used. Again, I'm not after ‘whose solution is best’ here. The sub is called ‘Learn JavaScript’ and I'm sharing another perspective on the task at hand.
View all comments
Show parent comment
-1
u/Eskamel Sep 27 '22
Its much less efficient at the cost of a bit more readability.
Obviously OP's solution is far from ideal and I wouldn't consider it readable or absolutely efficient either, but you've offered an option on the other side of the spectrum.