[23.08.25] 문자열 돌리기

Heera1·2023년 8월 28일

Algorithm

목록 보기
4/8
post-thumbnail
const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];

rl.on('line', function (line) {
    input = [line];
}).on('close',function(){
    str = input[0];
    str1 = [...str]
    str1.map(a => console.log(a))
});

map 을 사용해서 console.log로 하나씩 출력하면 됐다.

profile
웹 개발자

0개의 댓글