今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Iterate over values in a set
- [Instructor] Before we move into the next two set methods, let's take a quick review on iterators. We've learned about what an iterator is earlier in this course, and we know that it is an object that defines a sequence. We will use the property next to iterate over the iterator that is returned by the set methods, values and entries. In this lesson, we're going to talk about the values method. Just like the values method on map, the values method for set also returns an iterator object with the values in their insertion order. To utilize this method, we will simply apply the method to an existing set. This method does not take any arguments and is best utilized being set to a variable that you can access as needed. If we want to access any of the values of the iterator, that have been returned by the values method, we will apply the next method to that variable and then a value property. Let's take a look at our invites…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
The Set object defined57 秒
-
(已锁定)
Add values to your set3 分钟 17 秒
-
(已锁定)
Does Set have your value?3 分钟 9 秒
-
Get your set size2 分钟 2 秒
-
(已锁定)
Delete and clear values in your set2 分钟 46 秒
-
(已锁定)
Iterate over values in a set2 分钟 45 秒
-
(已锁定)
Iterate over a set with entries2 分钟 25 秒
-
(已锁定)
Iterate over your set with forEach2 分钟 29 秒
-
(已锁定)
Solution: Sets 12 分钟 8 秒
-
(已锁定)
Solution: Sets 22 分钟 35 秒
-
-
-