When someone clicks the countButton button, count the temperatures in the temps list that are above 70, and show the count in the countLabel label.
The label shows 3 warm days.
11 strips: J1 to J11
} J1var temps = [75, 61, 58, 80, 77, 66]; J2if (temps[i] > 70) { J3}); J4var count = 0; J5onEvent("countButton", "click", function() { J6count = count + 1; J7setText("countLabel", count + " warm days"); J8for (var i = 0; i < temps.length; i++) { J9for (var i = 1; i < temps.length; i++) { J10} J11Order: J2, J6, J5, J9, J3, J7, J11, J1, J8, J4. Extra: J10
var temps = [75, 61, 58, 80, 77, 66];
onEvent("countButton", "click", function() {
var count = 0;
for (var i = 0; i < temps.length; i++) {
if (temps[i] > 70) {
count = count + 1;
}
}
setText("countLabel", count + " warm days");
}); Extra strip: for (var i = 1; i < temps.length; i++) {. The first item is at index 0. Starting at 1 skips the 75, so the label shows 2 warm days.