“It is possible to release a JavaScript program as free software, by distributing the source code under a free software license. If the program is self-contained—if its functioning and purpose are independent of the page it came in—that is fine; you can copy it to a file on your machine, modify it, and visit that file with a browser to run it. But that is an unusual case.” [0]
JS code can obviously be client-side (generally readable in a browser via View Source, but not always, unless I am mistaken) or server-side (not generally readable, unless explicitly shared by the devs).
But based on [1] and [2] and [3], it appears that JS the language is owned and maintained by ECMA, which is a not-for-profit standards org.
So then I’m still a bit confused as to who whose lawyers would be coming after you if you published some JS code on Github or your own web-site? Not the ECMA’s right?
[0] https://www.gnu.org/philosophy/javascript-trap.html [1] https://en.m.wikipedia.org/wiki/JavaScript [2] https://en.m.wikipedia.org/wiki/Ecma_International [3] https://www.quora.com/Who-is-the-owner-of-javascript