Skip to content

Commit 74d72db

Browse files
committed
🚩: 문자열을 map으로 접근 시도, error
1 parent 1cce0ad commit 74d72db

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

javascript/source/dev/stdin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Hello, World!
1+
26

javascript/source/printer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
let path = require('path');
22
let inputPath = path.join(__dirname, '/dev/stdin'); // __dirname은 현재 스크립트의 디렉토리 절대경로
3-
let input = require('fs').readFileSync(inputPath).toString().trim().split('\r\n');
3+
let input = require('fs').readFileSync(inputPath).toString().trim().split('\n'); //\r\n
44
//let input = require('fs').readFileSync('/dev/stdin').toString().trim().split('\n'); //백준 제출
55

6-
console.log('Hello, World!');
6+
console.log(input[0].length);
7+
input[0].map(el => {
8+
console.log(el);
9+
})
10+

0 commit comments

Comments
 (0)