Skip to content

Cleanup solution for Filter Anagrams task #2025

New issue

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Separate call chain with new lines
  • Loading branch information
dmrnz authored Jan 23, 2025
commit ea852e723e9dc64836b3b66fb65a9d64c28d6583
7 changes: 6 additions & 1 deletion 1-js/05-data-types/07-map-set/02-filter-anagrams/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ function aclean(arr) {
let obj = {};

for (let word of arr) {
let sorted = word.toLowerCase().split("").sort().join("");
let sorted = word
.toLowerCase()
.split("")
.sort()
.join("");

obj[sorted] = word;
}

Expand Down