UNPKG
@s-awaken/lotide
Version:
latest (1.0.3)
1.0.3
1.0.2
1.0.1
1.0.0
Syrym's project for Lighthouse Labs Bootcamp
github.com/s-awaken/lotide
s-awaken/lotide
@s-awaken/lotide
/
without.js
12 lines
(11 loc)
•
277 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
const
without =
function
(
array1, array2
) {
const
newArray = [];
for
(
let
i =
0
; i < array1.
length
; i++) {
const
found = array2.
find
(
(
ele
) =>
ele === array1[i]);
if
(!found) { newArray.
push
(array1[i]); } }
return
newArray; };
module
.
exports
= without;