UNPKG
@lucide/helpers
Version:
latest (1.0.0)
1.0.0
A internal used package with helpers.
@lucide/helpers
/
src
/
mergeArrays.mjs
13 lines
(12 loc)
•
232 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/** * Merge two arrays and remove duplicates * *
@param
{
array
}
a
*
@param
{
array
}
b
*
@returns
{
array
} */
export
const
mergeArrays
= (
a, b
) => { a = a.
concat
(b); a = a.
filter
(
(
i, p
) =>
a.
indexOf
(i) === p);
return
a; };