Why doesn't my return
within the IF work?
function telephoneCheck(str) {
var a;
let result = false;
let str1 = str.split("");
if (
str1[0].isInteger === true &&
str1[1].isInteger === true &&
str1[2].isInteger === true &&
str1[3] === "-" &&
str1[4].isInteger === true &&
str1[5].isInteger === true &&
str1[6].isInteger === true &&
str1[7] === "-" &&
str1[8].isInteger === true &&
str1[9].isInteger === true &&
str1[10].isInteger === true &&
str1[11].isInteger === true
) {
return true;
}
}
telephoneCheck("555-555-5555");