third iteration
This commit is contained in:
parent
8e57c6e4c3
commit
0fb90a17cd
|
@ -1,3 +1,34 @@
|
|||
// Third iteration:
|
||||
|
||||
const removeFromArray = function([a, ...b], c, ...d) {
|
||||
let firstArray = [a, ...b];
|
||||
let secondArray = [c, ...d];
|
||||
console.table(firstArray);
|
||||
console.table(secondArray);
|
||||
|
||||
let combinedArray = [...firstArray, ...secondArray];
|
||||
|
||||
let removeDuplicates = [...new Set(combinedArray)]
|
||||
|
||||
}
|
||||
|
||||
removeFromArray(["a", "b", "c", "d"], "e", "f", "g")
|
||||
|
||||
// Need to figure out how to turn second parameter into an array
|
||||
|
||||
/*
|
||||
const removeFromArray = function([arrayOne], arrayTwo) {
|
||||
|
||||
function f(a, ...arrayTwo) {
|
||||
let newArray = [...arrayTwo];
|
||||
console.table(newArray)
|
||||
return newArray
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// Second iteration that fails test but can remove duplicates from arrays:
|
||||
|
||||
const removeFromArray = function([arrayOne], [arrayTwo]) {
|
||||
|
|
Loading…
Reference in New Issue