Smallest common multiple
The activity I was given on freecodecamp was a very difficult task and I was so confused where to even begin, but I got assisted first by my pears making me understand better before trying to attempt and solve the problem.
Problem
I must find the smallest common multiple of the provided parameters that can be evenly divided by both, as well as by all sequential numbers in the range between these parameters. The range will be an array of two numbers that will not necessarily be in numerical order.e.g. for 1 and 3 - find the smallest common multiple of both 1 and 3 that is evenly divisible by all numbers between 1 and 3.
Approach
I first sorted the numbers and assigned an empty array. I had a for-loop iterate through each an every value and an if-atatement which with check if the value is divisible by each an every value in the array. It should return false or true.
I assigned all the arguments and had a while-loop, function name which correct if the first function is not correct should then append.
Conclusion
I learned a lot from this exercise since I never used while loop and I hardly use it and the activity was tough.