Google will soon begin blocking Javascript attachments in Gmail in an effort to protect users form malicious attacks. The ban will take effect beginning February 13 and expands upon the service’s existing list of restricted file attachments, which also includes .exe, .msc and .bat archives. 

Similar to how it handles other restricted attachments, if you try to attach a .js file to an email on or after the 13th, you'll get a notification that says it's blocked "because its content presents a potential security issue." The service will detect .js files even if they're sent in compressed form as a .zip, for example.

If you still need to send .js files for legitimate reasons, Google suggests you use Google Drive, Google Cloud Storage, or other storage solutions to share or send your files

JavaScript is a common language used when developing web applications, and while .js files are not inherently bad, you shouldn’t open them if sent from an unknown source since hackers can use them to gain access to a user’s PC and install downloaders for a ransomware or other types of malware.

It’s unclear Google will also show a warning when users receive emails with JS files attached.