JavaScript: Tricks to shorten onkeydown, setInterval etc Are there any tricks to shorten defined function names like setInterval, onkeydown, onkeyup, createLinearGradient or even return?

When using it more than once it's nice to put it as a string into a variable and reuse it afterwards but most functions I only need once.

I know that ES6 has arrowed functions - maybe there is an apporach?
There is a rather clever trick for shortening method names for a particular object that I first learned about during the first JS1k competition.  See Martijn Haverbeke's page about it, under "Mechanized Abbreviation".

The idea is that you iterate over the keys of the object and apply a hash function h(k) to each of the keys in order to compute an alias for the key.  With some trickery you can make sure to only apply the aliasing to keys referring to function values (i.e. only if typeof o[k] == 'function'), but of course this costs some extra characters.  If only one of the keys being aliased hash to the same value, then you can use the abbreviated name unambiguously.  If there are collisions you have to fall back to the full name (since the order of iteration is undefined).

When using this trick, remember that it's a trade-off between length of hash function (expression) and number of collisions.  Of course, this approach is only helpful when you use a lot of long-name methods on one particular object (e.g. canvas code).  For a paricular snippet that you want to golf, it could be useful to find the number of occurrences of each identifier and put together something like this page, to simplify the search for a good hash function.

This trick could be used with global functions since the global object is this at the global scope (or even shorter, windows = window.top = top in a web environment).  Also, another thing to keep in mind with frequent use of methods on one object is the with statement.