今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Reverse array order with reverse
- [Instructor] You might be noticing a pattern with array, method, names and their function. The reverse method certainly does what it says it will do which is to reverse the order of an array. Using the reverse array method is fairly straightforward but there is one thing to remember when using this method it will change the original array to the newly reversed array. If you need to maintain the original array it would be best to create a new variable to apply the reverse method. If we look at a quick example, we see that simply applying the array method has reversed the order. Let's go to the code and discuss where the reverse array method would come in handy. We first have a list of condiments. How do we reverse the order of this array? As we learn using the reverse array method is just a matter of applying it to the array we want to reverse. If we log out the condiments array console.log, condiments.reverse…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。