JavaScript prime table generator