Find all files with the extension ".js" in the "/opt" directory and its subdirectories up to a maximum depth of 3, and copy them to the "~/scripts/" directory.
find /opt -name "*.js" -maxdepth 3 -exec cp {} ~/scripts/ ';'