Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Question 2(a)
- 3
- 4
- Question 2(b)
- 0
- 0
- 0
- Question 3(a)
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Question 3(b)
- 15
- 10
- 5
- Question 3(c)
- 0
- -3
- -2
- Question 4(a)
- function union(A, B) {
- var union = A
- for (var e of B) {
- if (A.includes(e) === false) {
- union.push(e)
- }
- }
- return union
- }
- Question 4(b)
- function difference(A, B) {
- var diff = []
- for (var e of A) {
- if (B.includes(e) === false) {
- diff.push(e)
- }
- }
- for (var e of B) {
- if (A.includes(e) === false) {
- diff.push(e)
- }
- }
- return diff
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement