21d_

doggoddog·2020년 9월 15일

일일 정리

목록 보기
25/34

devDependencies는 개발
dependencies는 실행에 필요하다
e.g. mocha같은 경우는 devDependencies에 들어가 있어야한다.

node test.js //파일 이름이 test.js
hello world

npm run hello

hello world

arr1.concat(arr2, arr3)
//arr1과 arr2, arr3를 연결하겠다.

Array.prototype.concat.call(arr1, arr2, arr3)
//연결하겠다 arr1과 arr2, arr3를.

concat이 Array.prototype에 연결돼있는 Array.prototype.concat이기 때문에
=>

유사배열에 적용하려면 이런 문법들을 적용해야함

객체에는 순서(인덱스)가 없어서 obj[0]으로 찾아서 자른다...

bind를 씀으로인해 onclick할 때 함수를 실행시킬 수 있다
전에는
li.onclick=function () { ~ }
으로 빈 함수전체를 써서 넣었었는데
bind를 사용해서
li.onclick=FcName.bind(null, obj) //bind뒤에 오는 ()안의 값은 더 정확히 이해할 필요가 있음
li.onclick=FcName.bind(user) //
이런식으로 함수자체를 저장해 둘 수 있다.

profile
----------------------------

0개의 댓글