// This doesn’t work
return $this->render(array('js' => $js_code));
A temporary solution is to register the “js” media type manually in /config/bootstrap/media.php (see Handler registration here). But since “js” is already there in the source code as one of the default media types, would be good to have it working out of the box.
js is there for a convenience when defining it on your own. Same is the case for xml.