Thought it would be a neat exercise to recreate the mIRC $gettok() function in javascript as I've seen it popup in several other languages. The only caveat I'm aware of is when passing multiple N parameters (eg: '2-6' or '2-'); it must be in string format. Otherwise javascript will interpret N and pass undesired results (eg: '-4'). If only passing one N parameter, integer use is recommended.