Limits the string or array to n character
n
Example usage:
import { limit } from "@thalesrc/js-utils"; const str = 'foobarbaz'; const array = ["a", "b", "c", "d", "e", "f"]; limit(str, 3); // 'foo' limit(array, 3); // ["a", "b", "c"]
Max count
Generated using TypeDoc
Limit
Limits the string or array to
n
characterExample usage:
import { limit } from "@thalesrc/js-utils"; const str = 'foobarbaz'; const array = ["a", "b", "c", "d", "e", "f"]; limit(str, 3); // 'foo' limit(array, 3); // ["a", "b", "c"]