function check(string) { var firstIndex = string.indexOf(','); return firstIndex > -1 && string.indexOf(',', firstIndex + 1) > -1; }