Skip to main content

Built and signed on GitHub Actions

Easily get the last element of an array

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.1.1)

Array.last

Get the last element of an array.

Usage

import last from "jsr:@cordor/array-last@1";

const array = [1, 2, 3];
console.log(last(array)); // 3

// Or

const array = [4, 5, 6];
console.log(array.last); // 6

License

MIT

Made with 💗 by Juliette Cordor

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@cordor/array-last

Import symbol

import * as array_last from "@cordor/array-last";

---- OR ----

Import directly with a jsr specifier

import * as array_last from "jsr:@cordor/array-last";

Add Package

npx jsr add @cordor/array-last

Import symbol

import * as array_last from "@cordor/array-last";

Add Package

yarn dlx jsr add @cordor/array-last

Import symbol

import * as array_last from "@cordor/array-last";

Add Package

pnpm dlx jsr add @cordor/array-last

Import symbol

import * as array_last from "@cordor/array-last";

Add Package

bunx jsr add @cordor/array-last

Import symbol

import * as array_last from "@cordor/array-last";