Duplicate files are sorted in reverse order of latest modification time. So, the first file in the set of duplicates is the oldest in term of modification time (mtime). By default, the file with oldest mtime in each set of duplicates will be preserved and the rest will be deleted.
fdupes -r .
fdupes -r -d .
fdupes -r -d -N .
fdupes -r . | grep -e '.js$' -e '^$' | uniq
fdupes -nrd --order=name .
fdupes -rdN [directory] ...
for f in $(fdupes -f .); do mv $f ./saveDirectory; done
$ brew install fdupes