课程: JavaScript Essential Training
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Solution: Array manipulation
(upbeat music) - [Instructor] For this challenge, we have a series of tasks that need to be executed in a specific sequence, so I've left the instructions open, so I can refer to it. All right, I'll scroll down to the processArray here, and we're placing our new code in between the comments. So number one, remove the last item from the array. For this, we can use the pop method. So I'll say newDeskArr.pop. This pops the last item off the array and returns it to us, so we can do something with it, but in our case, we just want to remove it, so I'll just leave it with that. Okay, number two, sort the remaining array items alphabetically. All right, so newDeskArr again. Here we can use the sort method. If we don't provide any parameters for it, it'll automatically sort the items alphabetically based on the first letter, which is what we want. All right, next, number three, move the last item of the array to the first…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。