In addition to the general range rules, there's a special numbering scheme for flights departing JFK. Flights scheduled to depart Terminal 2 start with 2 (215, 2073, etc). Flights scheduled to depart Terminal 4 start with 4 (401, 4036, etc).
Of course, not all 2xx/2xxx and 4xx/4xxx flights depart from JFK, but that numbering scheme is used for flights that do. (For operational reasons, flights do switch from their planned terminal on occasion)