This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (1) { | |
// 1번과제 [1, 2, 3, 4, 5, 6, 7].filter(it=> it%2).map(it=>it*2) 7회로 해결하기 입니다. | |
let cnt = 0; | |
const generator = function* (arr) { | |
for (let i = 0; i < arr.length; i++) { | |
cnt++; | |
if (arr[i] % 2) { | |
yield arr[i] * 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (1) { | |
// 꼬리재귀.. | |
const stringCheck = [ | |
[/[\r\n\l]/g, "\\n"], | |
[/"/g, '\\"', [/\t/g, "\\t"]], | |
]; | |
const el = { | |
number: (v) => v.toString(), | |
boolean: (v) => v.toString(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (1) { | |
const stringCheck = [ | |
[/[\r\n\l]/g, "\\n"], | |
[/"/g, '\\"', [/\t/g, "\\t"]], | |
]; | |
const el = { | |
number: (v) => v.toString(), | |
boolean: (v) => v.toString(), | |
string: (v) => { | |
for (let i = 0; i < stringCheck.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(1) { | |
// 1차월 배열의 합- 재귀 | |
const _sum = (arr, idx) => { | |
if(idx == 0) { | |
return arr[0]; | |
} | |
return arr[idx] += _sum(arr, (idx - 1)) | |
} |