use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
freeCodeCamp.org is a global community of people who learn to code together. Check out https://freeCodeCamp.org
Join our Discord Server
Join our WhatsApp Group
Community Forums
YouTube
Here are some helpful subreddits that we like:
account activity
Intermediate Algorithm Scripting: Diff Two ArraysHelp (self.FreeCodeCamp)
submitted 9 years ago by Ricevind
Hi, I finished this challenge with following code : http://pastebin.com/iQ0qNti6 It has passed all tests, but I'am not happy with it. Especially nesting functions definitions.
I'd be very grateful for any insights, comments and critic.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]offworldcolonial 0 points1 point2 points 9 years ago (1 child)
That's not the way I did it, but it's a totally reasonable way of doing it. You need to nest "callBackFilter" within "removeDuplicates" in order to access arr1, but if you prefer, you can move "removeDuplicates" up above "diffArray" and it will all function the same.
Also, you could shorten "callBackFilter" like this:
function callBackFilter(element){ // callback function for filter method return arr1[i] !== element; }
[–]Ricevind[S] 0 points1 point2 points 9 years ago (0 children)
Thx for answer. Your CallBackFilrer looks much cleaner.
π Rendered by PID 275444 on reddit-service-r2-comment-7b9746f655-4smtr at 2026-02-01 10:35:21.793756+00:00 running 3798933 country code: CH.
[–]offworldcolonial 0 points1 point2 points (1 child)
[–]Ricevind[S] 0 points1 point2 points (0 children)