Answer the question
In order to leave comments, you need to log in
What does the code mean?
Hello, tell me please.
I found the code in which the author builds a field for the game.
var context = canvas.getContext('2d');
for (var i in context)
{
context[i[0] + (i[4] || '')] = context[i];
console.log(context[i]);
}
// make shortcuts for canvas ops
// http://marijnhaverbeke.nl/js1k/
Answer the question
In order to leave comments, you need to log in
It's just a reference to another method. Thus, the author will be able to access the method not context.longLongMethod, but context.lL (or not context.meth, but context.m)
Pay attention to the URL:
http://marijnhaverbeke.nl/ js1k
This feature is needed for very small code competitions. In real applications, of course, such crap should not be used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question