function lastimport { last } from "https://deno.land/x/prelude_js@1.2.0/last.ts"; last<T extends string>(input: T): LastString<T>Returns the last element of the given string. last<T>(input: readonly [...unknown[], T]): TReturns the last element of the given tuple. last<T>(input: Iterable<T>): T | undefinedReturns the last element of the given iterable. Returns the last element of the given string. ExamplesExample 1 import { last } from "https://deno.land/x/prelude_js@$VERSION/last.ts"; import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; assertEquals(last(""), ""); assertEquals(last("abc"), "c"); Type ParametersT extends stringParametersinput: TAny string. ReturnsLastString<T>Returns the last element of the given tuple. ExamplesExample 1 import { last } from "https://deno.land/x/prelude_js@$VERSION/last.ts"; import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; assertEquals(last([]), undefined); assertEquals(last([1, 2, 3]), 3); Type ParametersTParametersinput: readonly [...unknown[], T]Any tuple. ReturnsTReturns the last element of the given iterable. ExamplesExample 1 import { last } from "https://deno.land/x/prelude_js@$VERSION/last.ts"; import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; assertEquals(last(new Set(["x", "y", "z"])), "z"); Type ParametersTParametersinput: Iterable<T>Any iterable. ReturnsT | undefined