일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- extends
- app:compiledebugkotlin
- 타입스크립트
- 리액트네이티브아이콘
- map
- 안드로이드빌드에러
- materialicons
- generic
- 이진탐색
- array
- forwardref type
- Spring
- 슬라이딩윈도우
- Filter
- react
- err_connection_refused
- 배열중복요소제거
- 스크롤이벤트
- npm에러
- TS
- app.post
- 상속
- reactnative error
- async
- interface
- mainapplication.kt
- set
- Next.js
- javascript
- reactnative
- Today
- Total
목록Html_css_js (55)
rhanziy
new Map() : 자료간의 연관성이나 연산을 표현하기위해 사용 // 자료이름(key)으로 글자말고도 가능. var people = new Map(); people.set([1,2,3], '123배열Kim'); people.set('age', '20'); // people.get('key'); 자료꺼내기 // people.size // 저장된 개수 // people.delete('key') 자료삭제 for(var key of people.keys()){ console.log(key); } var people2 = new Map([ [ 'name', 'Lee' ], [ 'age', '23' ] ]); 자주 쓰이진 않는다 ㅋ 콘솔 찍어보면 Map(2) {Array(3) => '123배열Kim', 'age'..
for반복문은 자주 썼지만,, ES6에서 오브젝트나 어레이에 더 접근하기 쉬운 반복문이 추가됐다. for ...in var obj = { name : 'Kim', age : 30 } for(var key in obj){ console.log(obj[key]); console.log(key); } // 결과 // Kim // 30 // name // age for ...in 은 enumerable(셀 수 있는) 자료만 사용 가능. 즉 object 자료형 클래스 객체라면 부모의 prototype도 반복해주는데 쓸데없기때문에 보통 hasOwnProperty(key) 를 사용해 걸러준다. obj.name의 숨겨진 정보(writable, enumerable, configurable)를 출력해보고 싶으면 Objec..
자바스크립트는 한번에 하나의 작업만 수행한다. 동기적(Synchronous)인 언어임. 이를 해결하기위한 비동기(Asynchronous) 처리방법이 있지. 1. 콜백 함수 2.Promise 3. async await 이렇게 크게 3가지 비동기 방식이 존재한다. 콜백함수는 화살표함수로 많이들 사용하고 계시졍? 잘못쓰면 콜백지옥에 빠진다는 그 것. 콜백함수 내에서 error나 success처리를 보다 간단하게 하기 위해 Promise가 탄생함! Promise는 new Promise() 로 생성할 수 있고, 세가지 상태를 갖는다. Pending(대기), Fulfilled(이행), Rejected(거부) var loading = new Promise(function (resolve, reject) { var i..
오브젝트나 클래스를 만들면 데이터를 출력/수정할 때 데이터의 무결성을 위해 함수를 만들어서 다룬다. 거기서 get과 set을 이용해 소괄호를 안쓰고도 기능을 실행시킬 수 있다. 함수의 프로퍼티화 라고 함. var 사람 = { name: 'Park', age : 29, get nextAge(){ return this.age + 1; // return이 있어야함. 파라미터x }, set setAge(age){ this.age = parseInt(age); // 파라미터가 1개 있어야함. } } // property화. 소괄호를 붙이지 않고도 기능실행 사람.setAge = '20'; 사람.nextAge; 주석에 써놨다싶이 get을 쓸 땐 return을 명시해줘야하고, 파라미터는 작성하면안됨 set을 쓸 땐 파..
ES6 문법으로 상속을 구현해보자. extends의 출현!!! 부모 class의 constructor를 상속받아서 새로운 class를 생성하기. class 할아버지 { constructor(name){ this.성 = 'Kim'; this.이름 = name; } sayHi(){ console.log('할아버지예요'); } } var 할아버지1 = new 할아버지('만수'); class 아버지 extends 할아버지 { constructor(name){ super(name); // 부모 class의 constructor this.나이 = 50; } sayHi(){ console.log('아버지예요'); super.sayHi(); // 부모 class의 prototype } } var 아버지1 = new 아..
// 옛날방식 상속기능 const Student = function(name, age){ this.name = name, this.age = age } Student.prototype.sayHi = function(){ console.log(`안녕 나는 ${this.name}이야`); } let 학생1 = new Student('Kim', 20); 학생1.sayHi(); var arr = [1,2,3]; var arr2 = [3,6,8,3,2,5,7]; Array.prototype.remove3 = function(){ for(let i = 0; i < this.length; i++){ if(this[i] == 3){ this.splice(i,1); } } } arr.remove3(); arr2.remo..
var products = [ { id: 0, price: 70000, title: 'Blossom Dress' }, { id: 1, price: 50000, title: 'Springfield Shirt' }, { id: 2, price: 60000, title: 'Black Monastery' } ] // 데이터 형식 function addTemplet(data){ data.forEach((e)=>{ var card = ` ${e.title} 가격 : ${e.price} 구매 ` $('.row').append(card); }) } // 데이터에 맞게 카드형식으로 html append 우선 데이터를 카드 식으로 화면에 뿌려준다. $('.buy').click(function(e){ var title = ..
const button = $('.tab-button'); const content = $('.tab-content'); $('.list').click(function(e){ tabOpen(Number(e.target.dataset.id)); }); function tabOpen(i){ button.removeClass('orange'); button.eq(i).addClass('orange'); content.removeClass('show'); content.eq(i).addClass('show'); } tab버튼 구현하다가 맞닥뜨린 문제. li에 data-id ="0" 데이터 값을 부여해서 그에 맞는 컨텐츠를 보여주는 코드인데.. 제이쿼리랑 같이 쓰다보니 data값을 못가져오는 오류가 났다. tab..