In life, every profession, job, trade, knowledge, etc., requires understanding and knowledge of their foundations, to master and perfect their creation, use and maintenance; to thereby become capable of creating ever more complex and reliable things. In this way, programming 💻 is not the exception and, probably, that statement is, rather, the starting point and the most crucial of this journey.
Speaking more specifically and, regardless of the language of your taste, in Javascript, some of its fundamentals, probably, are algorithms, loops, conditionals, etc. Given this small introduction, I will go to the point and leave here some ways to solve certain operations or situations (these can be random, specific or circumstantial) in particular...