function solution(phone){ let result="" var num1 = phone.substring(0,2) var num2 = phone.substring(2,6) var num3 = phone.substring(6,10) result = 0+num1+'-'+num2+'-'+num3 return result; } console.log(solution("1062509911"))