今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Evaluating single value 2
(upbeat music) - [Instructor] In this challenge, we've been given an array of tasks and we want to determine has every single task in that array has it been completed? So we learned about some array methods, some and every. And in this particular case, since we want to determine if every single one has been completed, we're going to use the every method. So first I'm going to write my return statement and then tasks, and then we will apply that every method and we'll use, I'm just going to put TSK, that will represent the individual task. And just for fun, I'm going to do this, what I'll call the long way instead of implicitly returning in case this is how some folks feel more comfortable. So very similar to the way I've shown you different solutions, but I'm not implicitly returning here. I'm actually going to have to write out my return statement. Here I want to know, has every task been completed? So effectively, TSK, which is what we passed in here, this represents each object…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。