文字列処理ベース(プログラマ)
3237 ワード
問題の説明
せいげんじょうけん
に答える function solution(s) {
let answer = true;
if(s.length === 4 || s.length === 6){
const sArr = s.split('');
sArr.forEach(s=>{
if(s.charCodeAt(0)<48 || s.charCodeAt(0)>58)
return answer = false;
})
}
else
return false;
return answer;
}
チェックポイント
function solution(s) {
let answer = true;
if(s.length === 4 || s.length === 6){
const sArr = s.split('');
sArr.forEach(s=>{
if(s.charCodeAt(0)<48 || s.charCodeAt(0)>58)
return answer = false;
})
}
else
return false;
return answer;
}
Reference
この問題について(文字列処理ベース(プログラマ)), 我々は、より多くの情報をここで見つけました https://velog.io/@vsnm25/문자열-다루기-기본テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol