Trouble with function inside of loop

Trouble with function inside of loop
0

#1

I’ve tried using a function expression and an immediately invoked function but it is still giving me this warning. I know this is a beginner mistake and deals with closures. I just need some help.


#2

What are you trying to do in general? What challenge are you working on?


#3

Currently trying to complete the Smallest Common Multiple Algorithm. I’m trying to make a function that tests whether a number is divisible by all the items inside of an array. x in the function is the number that is being checked whether is it divisible by all the items in the array and y is supposed to represent all the items in the array.


#4

That message is just a warning. It is not an actual error message. You can continue to use the IIFE in your code. It should not given you an error message (other than the warning).