안효원 안효원 2022-02-23
cleaner
@0eedcc3675918cdd31bb32004ed9322bea493508
al01/section1/13.js
--- al01/section1/13.js
+++ al01/section1/13.js
@@ -7,11 +7,16 @@
         let asciiNum = s.charCodeAt();   //char->ASCII
 
         if(asciiNum >= 65 && asciiNum <= 90) answer += String.fromCharCode(asciiNum + 32);   //upper->lower
-        else /*****************************/ answer += String.fromCharCode(asciiNum - 32);   //lower->upper
+        else if(asciiNum >= 97 && asciiNum <= 122) answer += String.fromCharCode(asciiNum - 32);   //lower->upper
+        else answer += "";
     }
 
     return answer;
 
 }
 
-console.log(solution("StuDY"));                     
(No newline at end of file)
+<<<<<<< HEAD:al01/section1/13.js
+console.log(solution("StuDY"));                     
+=======
+console.log(solution("Stu2DY"));
+>>>>>>> 91263eaf691a88a927df52284ec9b59e34f7477a:al01/13.js
al01/section1/15.js
--- al01/section1/15.js
+++ al01/section1/15.js
@@ -1,11 +1,7 @@
 function solution(str){
 
-    if(str.length % 2 == 0){
-        return str.substr((str.length / 2) - 1, 2);
-    }else {
-        return str.substr((str.length / 2), 1);
-    }
-
+    if(str.length % 2 == 0) return str.substr((str.length / 2) - 1, 2);
+    else /****************/ return str.substr((str.length / 2), 1);
 }
 
 console.log(solution("study"));
Add a comment
List