(bigSet, smallSet)
| 44 | * @returns {boolean} returns true if smallSet contains all elements inside of the bigSet |
| 45 | */ |
| 46 | const isSubset = (bigSet, smallSet) => { |
| 47 | if (bigSet.size < smallSet.size) return false; |
| 48 | for (const item of smallSet) { |
| 49 | if (!bigSet.has(item)) return false; |
| 50 | } |
| 51 | return true; |
| 52 | }; |
| 53 | |
| 54 | /** |
| 55 | * Returns found item. |
no test coverage detected