We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
첫번째 인자로 주어지는 배열 요소들을 기준으로 두번째 인자로 주어지는 배열 요소들을 완전히 포함하는지(부분집합)에 대한 유무를 반환합니다. 라이브러이에 합집합, 차집합, 교집합은 구현이 완료되어 있으나, 부분집합은 없는 듯하여 아이디어를 내봅니다.
const arr1 = [1,2,3,4,5]; const arr2 = [1,3]; const arr3 = [6,7,8]; console.log(isSubset(arr1, arr2)); // true console.log(isSubset(arr1, arr3)); // true
The text was updated successfully, but these errors were encountered:
@beberiche 너무 좋은 아이디어 같습니다 의견 감사합니다! 단, 추가적인 의견으로 각 요소들이 원시값뿐만 아니라 참조형일 때도 3번째 인자인 iteratee를 통해 해당 함수 결과값으로 판단하는게 추가 되면 조흘 것 같습니다.
예를 들어 아래와 같습니다.
const arr1 = [{ id: 1}, { id: 2 }, {id: 3}]; const arr2 = [{ id: 1}, { id: 2 }]; isSubset(arr1, arr2, (item) => item.id); // true
또한 작업 폴더는 validator로 진행해주시면 감사드립니다 🙏 효율성을 위해 set과 iteratee 여부를 통해 적절하게 적용되었으면 합니다 🤗
validator
Sorry, something went wrong.
beberiche
Successfully merging a pull request may close this issue.
Package Scope
Overview
첫번째 인자로 주어지는 배열 요소들을 기준으로 두번째 인자로 주어지는 배열 요소들을 완전히 포함하는지(부분집합)에 대한 유무를 반환합니다.
라이브러이에 합집합, 차집합, 교집합은 구현이 완료되어 있으나, 부분집합은 없는 듯하여 아이디어를 내봅니다.
The text was updated successfully, but these errors were encountered: