DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • prototype
    • concat
    • forEach
    • indexOf
    • join
    • pop
    • push
    • replace
    • reverse
    • shift
    • slice
    • splice
    • unshift
  • static
    • can.List.Map
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • can.List
  • /
  • reverse
  • / On this page
    • reverse

      function

      Reverse the order of a List.

      • source

      list.reverse()

      reverse reverses the elements of the List in place.

      Returns

      {can.List}:

      the List, for chaining

      var list = new can.List(['Alice', 'Bob', 'Eve']);
      var reversedList = list.reverse();
      
      reversedList.attr(); // ['Eve', 'Bob', 'Alice'];
      list === reversedList; // true
      

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.