While browsing through a Library called WebApp.net, I stumbled upon this interesting piece of code:
var $h = {
get HEAD() { return 0 },
get BACK() { return 1 },
get HOME() { return 2 },
get LEFT() { return 3 },
get RIGHT() { return 4 },
get TITLE() { return 5 }
};
var $d = {
get L2R() { return +1 },
get R2L() { return -1 }
};
Having some knowledge of JS, I find this code rather confusing. Chrome interprets it as an Object with properties like $h.HEAD set to certain numbers after the return statement. It also seems to involve getters within $h.
I'm curious to learn more about this. Unlike Chrome, IE fails to interpret this code, so I need to figure out how to create something similar that works in IE.