课程: JavaScript: The Tricky Bits

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Challenge: Iterate differently

Challenge: Iterate differently

(upbeat music) - [Instructor] In this challenge, it's time to work with some data iterating and processing it without using any for loops. Here in Chrome, I can see what I'm getting at here. I'm going to have a select box with a variety of states, which I've totally made up their names. And once I choose one, I'm going to get the total population and the mean population. These values are just placeholders for now. Let's take a look at the source code to see what we have to start out with. Here's the HTML, and here is my states select box, which starts out with nothing except for a blank choose element. And then here are my placeholders where the total population and the mean population will go. And I'm using tailwinds hidden class to make sure that this is not displayed when the page first loads. Won't appear until we actually have something to display. And then over here in the JavaScript file, we can see our…

内容