Skip to content
Advertisement

Smallest Number Function

Trying to make a simple function that determines the smallest number in a list of numbers. For some reason, it looks like my for loop is only executing once for some reason with this function. What am I missing?

JavaScript

Advertisement

Answer

Your return statement is in your for loop. Remove the last indent of your return, and it should work fine.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement