Google says this is a move to improve security. You’ll still be able to use Google Drive to share such files.
Gmail already blocks files with .exe and some other extensions. The new move means files with .js extensions will also be blocked from sharing. For the uninitiated, even extensions like .msc and .bat are blocked from being shared as attachments on Google.
On the one hand, this may be cumbersome for some users. On the other, it does help in improving security on attachments. Attackers do not usually share Google Drive files and infecting a computer is easier with files with .exe and .js extensions.