-
Notifications
You must be signed in to change notification settings - Fork 0
length
김태헌 edited this page Sep 26, 2024
·
4 revisions
import { length } from 'mori-ts';
const str = "Hello, Mori!";
const result = length(str);
console.log(result); // 출력: 12
import { length } from 'mori-ts';
const arr = [1, 2, 3, 4, 5];
const result = length(arr);
console.log(result); // 출력: 5
import { length } from 'mori-ts';
const emptyArr = [];
const result = length(emptyArr);
console.log(result); // 출력: 0
import { pipe, range, length } from 'mori-ts';
const res = pipe(range(1, 10), length);
console.log(res); // 출력: 9
const res2 = pipe(range(1, 5), toAsync, length);
res2.then(console.log); // 출력: 4
https://github.com/gangnamssal/mori-ts/blob/main/src/test/length.spec.ts