DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
    • can-component
    • can-compute
    • can-connect
    • can-define
    • can-define/list/list
      • events
        • add
        • length
        • propertyName
        • remove
      • prototype
        • concat
        • filter
        • forEach
        • get
        • indexOf
        • join
        • map
        • on
        • pop
        • push
        • replace
        • reverse
        • serialize
        • set
        • shift
        • slice
        • sort
        • splice
        • unshift
        • *
        • #
      • static
        • extend
    • can-define/map/map
    • can-route
    • can-route-pushstate
    • can-set
    • can-stache
    • can-stache/helpers/route
    • can-stache-bindings
  • Ecosystem
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Core
  • /
  • can-define/list/list
  • /
  • pop
  • / On this page
    • pop

      function

      Remove an element from the end of a DefineList.

      • source

      list.pop()

      pop removes an element from the end of a DefineList.

      var names = new DefineList(['Alice', 'Bob', 'Eve']);
      names.pop() //-> 'Eve'
      

      Returns

      {*}:

      The element just popped off the DefineList, or undefined if the DefineList was empty

      Use

      pop is the opposite action from push:

      var list = new DefineList(['Alice', 'Bob', 'Eve']);
      
      list.pop(); // 'Eve'
      list.pop(); // 'Bob'
      list.pop(); // 'Alice'
      list.pop(); // undefined
      

      Events

      pop causes remove and length events to be fired if the DefineList is not empty when it is called.

      See also

      pop has its counterpart in push, or you may be looking for unshift and its counterpart shift.

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