Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialbradley maybee
5,249 Pointshey there can someone help me with this? its saying not logged in order but when i check in my console it works
thanks for any help
var temperatures = [100,90,99,80,70,65,30,10];
function printList( list ){
var listHTML = '<ol>';
for (var i = 0; i < list.length; i += 1){
listHTML +='<li>' + list[i] + '</li>';
}
listHTML += '</ol>';
print(listHTML);
}
console.log(temperatures);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
bradley maybee
5,249 Pointsits the challenge im trying to pass
2 Answers
Jacob Mishkin
23,118 PointsIts cool, first remove the function from the challenge. All it wants is either a for loop or a while loop that iterates through the variable temperatures, and then logs the iteration in the console inside the loop. No need to create a list item. It just wants you to log he info in the console.
Let me know if you need more info.
bradley maybee
5,249 Pointsthank you got it working
Jacob Mishkin
23,118 PointsAwesome!
glad I could help.
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 Pointsare you trying to pass the challenge or is this for yourself?
The reason I ask, is because the code challenges are very tight about what they will accept and not.