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
  • /
  • concat
  • / On this page
    • concat

      function

      Merge many collections together into a List.

      • source

      list.concat(...args)

      Parameters

      1. args {Array|can.List|*}:

        Any number of arrays, Lists, or values to add in For each parameter given, if it is an Array or a List, each of its elements will be added to the end of the concatenated List. Otherwise, the parameter itself will be added.

      concat makes a new List with the elements of the List followed by the elements of the parameters.

      var list = new can.List();
      var newList = list.concat(
          'Alice',
          ['Bob', 'Charlie']),
          new can.List(['Daniel', 'Eve']),
          {f: 'Francis'}
      );
      newList.attr(); // ['Alice', 'Bob', 'Charlie', 'Daniel', 'Eve', {f: 'Francis'}]
      

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