Well others have already explained what it does but I feel compelled to stick my opinion in here anyway.

You just found out that $() can be used outside of event matchtext/window definitions instead of using $eval(). I've only got one thing to add: Please don't use it for that purpose. It's a horrible thing to do for two main reasons:

1. It isn't documented to work outside of event definitions. Nor is the second n parameter documented to exist at all for this identifier. It's unlikely that Khaled would ever remove that functionality since it already exists but it's a really terrible thing to use undocumented features when there's a fully documented identifier ($eval()) right there.

2. Well you just experienced this: there's no way to know what $() does without reading the helpfile (and even then you have to realise to look under $(...)). It is the epitome of non-self-documenting code and it's absolutely the most annoying thing in the world to see scripters use it to save four bytes in their script - completely ignorant to how much it obfuscates their code.

OK, so I know you didn't even say you intended to use $() in regular code, but it's suprising how many people find out about this "$eval() shortcut" and start using it everywhere. I'm just trying to pre-empt the spread of bad scripting practices.