How do I add a javascript file?+issues

Can I do it like I can add a CSS file, so if I just copy the contents into a specially formatted card the .js will be usable by the site?