본문 바로가기

분류 전체보기296

(error)dependencies artifactid cannot be empty maven project 생성 시 pom.xml에서 dependecies 탭을 열어 maven 업데이트를 하려고 하는데 'artifactid cannot be empty' 에러가 떴다. 이클립스를 껐다 다시 켜니 자동으로 하단에서 업데이트 되엇다. 참고한 사이트는 다음과 같다. update index 하는데 20~30분 걸림... 참고... 여기서 해결하였다. https://stackoverflow.com/questions/18047843/cannot-search-for-artifact-in-eclipse-kepler-using-m2e-plugin 2022. 8. 21.
상속, prototype 상속, prototype const bmw = { color: "red", wheels: 4, navigation: 1, drive(){ console.log("drive.."); }, }; const benz={ color:"black", wheels:4, drive(){ console.log("drive.."); }, }; const audi ={ color: "blue", wheels: 4, drive(){ console.log("drive.."); }, }; console.log(bmw) ==========>proto를 써서 상속하기 일명 공통 모듈 만들기 const car = { wheels:4, drive() { console.log("dirve"); } } const bmw = { color.. 2022. 2. 26.
call, apply,bind call, apply, bind : 함수 호출 방식과 관계없이 this를 지정할 수 있다. call 콜 메서드는 모든 함수에서 사용할 수 있으며, this를 특정값으로 지정할 수 있다. 매개변수가 있으면 호출하며 실행한다 const mike={ name : "Mike", }; const tom ={ name: "Tom", }; function showThisName(){ console.log(this.name); }; showThisName(); //"" showThisName.call(mike); //"miki" /////////update를 만들어 내용을 더 추가하자 const mike={ name : "Mike", }; const tom ={ name: "Tom", }; function showTh.. 2022. 2. 26.
setTimeout/SetInterval setTimeout /일정 시간이 지난 후 함수 실행 setInterval /일정 시간 간격으로 함수 반복 function fn(){ console.log(3) } setTimeout(fn,3000); 3 => 이 코드와 같다 setTimeout(function(){ console.log(3) },3000); function showName(name) { console.log(name); } setTimeout(showName, 3000, 'Mike'); 함수 시간 인수 clearTimeout(tId); 예정된 작업을 없앨 때 쓴다. 스케줄링을 취소시킨다. 함수 앞에 붙인다. setInterval /일정 시간 간격으로 함수 반복 function showName(name) { console.log(name.. 2022. 2. 25.