-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.js
More file actions
26 lines (16 loc) · 680 Bytes
/
new.js
File metadata and controls
26 lines (16 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// helper function for ngIf's
// const and = (...x) => x.reduce( (x,y) => x && y );
// let boola = true;
// let boolb = false;
// let boolc = true;
// let boold = false;
// console.log(and(boola, !boolb, boolc, !boold));
// ex.
// ngIf*="boola && !boolb && boolc && !boold"
// ngIf*="and(boola, !boolb, boolc, !boold)"
// let array = [1,2,3,4,5];
// console.log(array[4]);
// merge two sorted arrays
const merge = (arr1, arr2) => {if (arr1.length && arr2.length) return result = arr1.concat(arr2).sort((a,b)=> {return a - b}); else return 'no length';};
console.log("merge success? :::",merge([4,7,2,9], [3,6,5,8]));
console.log("merge success? :::",merge([], []));