1.0.1 • Published 3 years ago

nv-array-fixed-length-push-only v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

nv-array-fixed-length-push-only

  • nv-array-fixed-length-push-only
  • small fixed-size push-only array

install

  • npm install nv-array-fixed-length-push-only

usage

example

        const FA=require("nv-array-fixed-length-push-only").FixedArray

        var ary = new FA(7,undefined)

        /*
        > ary
        FixedArray(7) [
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined
        ]

        >
        > ary.top_
        Top(1) [ 0 ]
        > ary.empty_
        undefined
        >
        > ary.length_
        0
        > ary.length
        7
        >

        */

        ary.push('A')

        /*
        FixedArray(7) [
          'A',       undefined,
          undefined, undefined,
          undefined, undefined,
          undefined
        ]
        */
        ary.push('B','C','D')
        /*
        >
        FixedArray(7) [ 'A', 'B', 'C', 'D', undefined, undefined, undefined ]
        >
        > ary.length
        7
        > ary.length_
        4
        >

        */
        ary.push('E','F','G')

        /*
        FixedArray(7) [
          'A', 'B', 'C',
          'D', 'E', 'F',
          'G'
        ]
        >

        >

        */
        ary.push('H','I')
        /*
        FixedArray(7) [
          'C', 'D', 'E',
          'F', 'G', 'H',
          'I'
        ]
        >
        */ 
        ary.push('J','K')

        /*
        FixedArray(7) [
          'E', 'F', 'G',
          'H', 'I', 'J',
          'K'
        ]
        >
        */

        ary.clear()

        /*
        FixedArray(7) [
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined
        ]
        >
        > ary.top_
        Top(1) [ 0 ]
        >

        */

API

METHODS

    ary._push
    ary._push_eles
    ary._push_one
    ary.clear
    ary.empty_
    ary.length_
    ary.push
    ary.push_eles
    ary.push_one
    ary.size_
    ary.top_

LICENSE

  • ISC