A warning telling you that some files are blocked will pop up, and you won’t be able to attach a .js file to an outgoing email in Gmail no matter what you do. You can’t even archive it. Google will detect .js files in archives including .zip, .tgz, .gz, and .bz2 files, so there’s no point trying.
Naturally, if you have genuine reasons to share .js files, you still can do it, but you’ll have to go through Google Drive instead of attaching them to Gmail emails.
It’s great to see Google strengthening Gmail security, especially in light of the fact that hackers continuously come up with more sophisticated attacks. Just recently, Gmail users discovered a pretty scary phishing attack that’s able to fool even some of the most savvy Android users into handing hackers their Google account credentials.