Tell us what’s happening:
I am currently working on the Smallest Common Multiple challenge. What I want to know how to do at this stage is to check the code I have written so far? If I run the test on @freeCodeCamp it just says the output should be this etc…I haven’t fully written the whole code yet. I want to check the first part of the code to see if that is doing what I want it to do first. How do I do that? I have looked online and most things seem to suggest I have to write a unit test to do that. That seems a bit too much for a beginner. Please note that yes I am a beginner and most of the terminology is still new to me. I am getting frustrated that a lot of the websites phrase things in a way that makes it difficult for a beginner to wrap their head around.
All I want to know at this stage is there an easy way to check whether small bits of my code are working?
Thanks
Your code so far
function smallestCommons(arr) {
var max = Math.max(arr[0], arr[1]);
var min = Math.min(arr[0], arr[1]);
var range = [];
for (let i = min; i<=max; i++){
range.push(i)
}
}
smallestCommons([1,5]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
.
Challenge: Smallest Common Multiple
Link to the challenge: