Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/array.js>endsWith

A JavaScript extension package for building strong and modern applications.
Latest
function endsWith
import { endsWith } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/array.js";

Checks if the array ends with the given suffix.

Examples

Example 1

import { endsWith } from "@ayonli/jsext/array";

const arr = [1, 2, 3, 4, 5];

console.log(endsWith(arr, [4, 5])); // true
console.log(endsWith(arr, [5, 4])); // false

Parameters

arr
suffix