Hello,
By testing the code given in the solutions the console in web browser returns Uncaught SyntaxError: Unexpected token ‘)’. By looking at the code the unwanted ´)´ token can be found in the code given in the solution c) in the second line “for (num in list)) {”
Also i experimented with the code a little bit further and changed the values that should be given to a list, to see if the code works with anygiven list of numbers. It turns out that the code doesnt perform well when it is given a different set of values in variable list. For example, when the list is described as: const list = [120, 4, 9, 7, 2, 8, 3, 1, 1100]; The returned values in the console for the smallest value is 2 and for the largest value is 120. I dont know if this is rellevant, but just wanted to share my findings with you.
Code, that is working with lists containing anygiven values looks like this:
const listValues = [120, 4, 9, 7, 2, 8, 3, 1, 1100]
var lowestValue = listValues[0]
var highestValue = listValues[0]
for (num in listValues){
if (listValues[num] < lowestValue){
lowestValue = listValues[num]
}
}
console.log(lowestValue)
for (num in listValues){
if (listValues[num] > highestValue){
highestValue = listValues[num]
}
}
console.log(highestValue)
Best,
Peter