Skip to content

Commit 4e4394d

Browse files
committed
refactor: compute only related function
1 parent 56ad9ee commit 4e4394d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: index.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,11 @@ const printResult = (followers, followings) => {
6161
};
6262

6363
followings.forEach((f) => {
64-
if (!followers.includes(f)) {
65-
only.followingOnly.push(f);
66-
}
64+
!followers.includes(f) ? only.followingOnly.push(f) : false;
6765
});
6866

6967
followers.forEach((f) => {
70-
if (!followings.includes(f)) {
71-
only.followerOnly.push(f);
72-
}
68+
!followings.includes(f) ? only.followerOnly.push(f) : false;
7369
});
7470

7571
console.log("--------------------------------------------------------");

0 commit comments

Comments
 (0)