This file contains 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
const odd = n=> !!(n & 0x1); | |
const half = n=>n >> 1; | |
{ | |
// 내가 짠거 | |
const odd = n=>half(n) == half(n - 1); | |
const half = n=>Math.floor(n/2); | |
} | |
{ | |
// hika pp. 29 | |
// n == parseInt(n/2) + parseInt(n/2); // 짝수인가? #1 |
This file contains 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 ('과제 210504 6강 끝나고 과제') { | |
` | |
과제 1 - 모든 값 타입을 인식하여 파싱하는 중첩된 배열 문자열 파서 | |
"[2, \"ㄹㅏㄹ\", [2, \"ㅕㅕ\"], [3, "4"]]" | |
과제 2 - 나만의 클래스타입을 인식하여 해당 클래스의 인스턴스를 만들어 넣어주는 기능 추가 | |
과제 3 - 기존 작성한 stringify 가 오브젝트인 경우 toJSON을 구현하고 있으면 그걸 이용해 stringify가 되도록 보수 | |
과제 4 - date의 json인 경우 date로 복원한다 | |
----> new Date().toJSON() | |
"2021-04-27T14:26:57.816Z" |
This file contains 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 - generator 는 습득이 0인 것 같아요....') { | |
let i = 0; | |
const copy = iter=>{ | |
iter.filter = (block)=>copy((function*(){ | |
for(const v of iter){ | |
i++; | |
if(block(v)) yield v; | |
console.log('filter skip', v); | |
} |
This file contains 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 ('과제 - 단수 obj stringify') { | |
Object.entries({}); //허용, 안쓰는 거 추천 | |
` | |
const abc = {_1:3, b:"abc"}; //[] x, {} x | |
stringify(abc)==JSON.stringify(abc) | |
` | |
} | |
const stringify89_4_210420 = (obj => { | |
// utils ==================================================== |
This file contains 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
const stringify89_3_210413 = (arr => { | |
// utils ==================================================== | |
const isDebug =_=>!1; | |
const quote = str=>`\"${str}\"`; | |
const _escape = { | |
table: [[/\"/g,'\\\"'] | |
,[/\t/g, '\\t'] | |
,[/[\r]/g, '\\r'] | |
,[/[\n]/g, '\\n'] |
This file contains 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
const arrayStringify = (arr => { | |
const quote = str=>`\"${str}\"`; | |
const _escape = str=>str.replace(/\"/g,'\\\"'); | |
const NULL_STR = 'null'; | |
const _arrayStringify = (arr) => { | |
let acc = []; | |
for (const item of arr) { | |
//const item = obj[k]; | |
//console.log('k', k, 'item', item); | |
//console.log('item', item); |
This file contains 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
const makeArr = (s, max)=> { | |
let res = []; | |
for (let i = s; i <= max; i++) { | |
res.push(i); | |
} | |
return res; | |
}; | |
console.log(makeArr(1, 10)); | |
const err = e=>{throw e;}; | |
const testF = (f, vList, logTitle = 'test')=>{ |
This file contains 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
# |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>76-1</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
.circle-1 { | |
position: relative; |
This file contains 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
// ==== space test ==== | |
let logL = {}; | |
logL.deb = false; | |
logL.inf = false; | |
const attrStrTest = 'class= "test clazz" readonly title=test!! class="test clazz" style= "width : 150px ;height:50px"'; | |
//getAttrList(attrStrTest); | |
const getAttrList = (attrStr) => { |
NewerOlder