phaser - v4.0.0-rc.4
    Preparing search index...
    • Adds the given item, or array of items, to the array.

      Each item must be unique within the array.

      The array is modified in-place and returned.

      You can optionally specify a limit to the maximum size of the array. If the quantity of items being added will take the array length over this limit, it will stop adding once the limit is reached.

      You can optionally specify a callback to be invoked for each item successfully added to the array.

      Parameters

      • array: any[]

        The array to be added to.

      • item: any

        The item, or array of items, to add to the array. Each item must be unique within the array.

      • Optionallimit: number

        Optional limit which caps the size of the array.

      • Optionalcallback: Function

        A callback to be invoked for each item successfully added to the array.

      • Optionalcontext: object

        The context in which the callback is invoked.

      Returns any[]