This is admittedly trivial, but it seems in theory that it would be possible. Consider this code:
<script>
var myscript = document.createElement("script");
myscript.setAttribute("src", url);
</script>
Is there a way to concatenate both of these operations into a single "statement," like this:
<script>
var myscript = (document.createElement("script")).setAttribute("src", url);
</script>
This doesn't work of course, with or without the added parentheses, but I'm thinking there must be a way to do it.