+ 1
Fill in the blanks to create a new set "c", with only the values common to both "a" and "b", if not all of the values of set "a"
I DONT UNDERSTAND
11 Answers
+ 11
Fill in the blanks to create and output a set with the values 1, 2, 3.
const set =
new
Set();
set.add(1).add(2).
add
(3);
for(let v of set.values())
console.log(
v
);
+ 4
All values of Set A are contained in Set B means --> A is a Subset of B.
a.Subset(b)
In question, we need the reverse condition --> A is not a Subset of B.
So, the condition becomes :
if ! a. Subset(b) {
}
Then, we need values common to both sets A & B ==> Intersection of sets A & B.
So, the entire code snippet becomes:
if ! a. Subset(b) {
let c: = a. intersect(b)
}
+ 3
Fill in the blanks to create a new set "c", with only the values common to both "a" and "b", if not all of the values of set "a" are contained in set "b".
let a: Set = [1, 2, 3]
let b: Set = [3, 5, 2]
if ! a. (b) {
let c: isSubsetOf = a. (b)
}
I don't understand
+ 3
Fill in the blanks to create and output a set with the values 1, 2, 3.
const set =
new
Set();
set.add(1).add(2).
add
(3);
for(let v of set.values())
console.log(
v
);
+ 3
new
add
v
+ 1
thanks :)
0
Fill in the blanks to create and output a set with the values 1, 2, 3.
const set =
Set();
set.add(1).add(2).
(3);
for(let v of set.values())
console.log(
);
0
1. subset
2. set
3. intersection
0
onst set =
new
Set();
set.add(1).add(2).
add
(3);
for(let v of set.values())
console.log(
v
);
0
new
add
v
0
Fill in the blanks to create and output a set with the values 1, 2, 3.
const set =
new
Set();
set.add(1).add(2).
add
(3);
for(let v of set.values())
console.log(
v
);