UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
utils
/
array
/
toEvenLength.ts
5 lines
(4 loc)
•
132 B
text/typescript
View Raw
1
2
3
4
5
export
function
toEvenLength
<
T
>(
array
: T[]
)
{
const
isEven
=
array
.length %
2
==
0
return
isEven ?
array
:
array
.
slice
(
0
, -
1
) }