Created
April 23, 2015 13:20
-
-
Save im7mortal/d561f03316edf31de358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phoneHome = '+7(43243)2-34-43'.split(''); | |
var num, num1, flag ; | |
for(var i = 0; i < phoneHome.length + 1; i++) { | |
console.log(phoneHome.length ); | |
if(i === 7) { | |
flag = true; | |
num = phoneHome[i]; | |
phoneHome[i] = ')'; | |
continue; | |
} | |
if(flag) { | |
num1 = phoneHome[i]; | |
phoneHome[i] = num; | |
num = num1; | |
} | |
} | |
console.log(phoneHome); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment