Yea, a tough one.
To debug it’s easier to copy paste the test specs from the left to after the function and console.log. Also it’s easier to use string .match method and console.log to see what is captured from the string using your regex. See below:
function telephoneCheck(str) {
return /^[\+]?([0-9][\s]?|[0-9]?)([(][0-9]{3}[)][\s]?|[0-9]{3}[-\s\.]?)[0-9]{3}[-\s\.]?[0-9]{4,6}$/ig.test(str);
}
console.log(telephoneCheck("2 (757) 622-7382")) // should return false.
console.log(telephoneCheck("0 (757) 622-7382")) // should return false.
let str = "2 (757) 622-7382"
let regex = /^[\+]?([0-9][\s]?|[0-9]?)([(][0-9]{3}[)][\s]?|[0-9]{3}[-\s\.]?)[0-9]{3}[-\s\.]?[0-9]{4,6}$/ig
let matched = str.match(regex);
console.log(matched)