Light-duty coders may be a bit frustrated when a browser or compiler chucks an error that cites a line number. Yes, you can get lovely third-party editors that make it much easier to work with such things, but what if you’re keen on simple TextEdit?
Hit Command+L to open a “Select Line” dialog. (It also lives, oddly, under the “Find” sub-menu.)
Type in a line number and you’re off to the races!
Source: Mac OSX Hints