今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Maps 2
(light upbeat music) - [Instructor] In this next challenge, we want to determine if a map has the key of Brandon. So if we look in our test code, we can see that the map has actually been set up for us. So that step has been removed. We just need to see at this point, does that map contain a specific key? So let's go ahead and write out our return statement. And then we need to reference the allUsers map. And we're going to be using the method has to determine if that key exists. And the key that we're looking for is Brandon. I'll mention this in several different videos and lessons, but when it comes to strings in JavaScript, it's really important that the case matches. So it's going to be looking for an exact match for Brandon. If we were looking for Alice, if we passed a lowercase A instead of capital A, it would return false for us. So it's really important to make sure that the casing matches. So here we have, we're returning allUsers, which is our map, and we're checking to see,…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
The Map object defined1 分钟 23 秒
-
(已锁定)
Build your Map object with the set method4 分钟 41 秒
-
(已锁定)
Access a value with get3 分钟 51 秒
-
(已锁定)
Does the map have your key?3 分钟 4 秒
-
(已锁定)
Determine map size2 分钟 6 秒
-
(已锁定)
Remove key-value pairs with clear and delete4 分钟 23 秒
-
(已锁定)
Map: Keys and values methods5 分钟 44 秒
-
(已锁定)
Map contents with the entries method2 分钟 32 秒
-
(已锁定)
Loop over a map with forEach2 分钟 38 秒
-
(已锁定)
Group entries with groupBy3 分钟 22 秒
-
(已锁定)
Solution: Maps 12 分钟
-
(已锁定)
Solution: Maps 21 分钟 32 秒
-
-
-
-
-