1.0.0 • Published 4 years ago

ts-last-item v1.0.0

Weekly downloads
52
License
MIT
Repository
github
Last release
4 years ago

Array#lastItem polyfill for TypeScript

This package includes the core-js polyfill for Array#lastItem, along with TypeScript typings.

The lastItem property is defined in this TC39 proposal.

Installation

npm install --save ts-last-item

Usage

import 'ts-last-item'

const list = [1, 2, 3]

console.log(list.lastItem)
//=> 3

list.lastItem = 5
console.log(list)
//=> [ 1, 2, 5 ]

API

The API specification is available in the TC39 proposal.