Skip to content

Commit 5594031

Browse files
committed
Updated code
1 parent 5349c10 commit 5594031

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

challenge2.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function caseChanger(str) {
2+
var arr = str.split('');
3+
var result = '';
4+
for (var i = 0; i < arr.length; i++) {
5+
if(i % 2 != 0) {
6+
result += arr[i].toUpperCase();
7+
}else{
8+
result += arr[i].toLowerCase();
9+
}
10+
}
11+
return result;
12+
}
13+
14+
console.log(caseChanger('buckyroberts'));

0 commit comments

Comments
 (0)