const phoneNumberFormat = (num) => { let newNum = num.replace(/[-]+/g, \'\'); let x; if (newNum.length <= 3) { x = newNum; } else if (n