| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- 자료구조
- 프로그래머스 자바스크립트
- 티스토리챌린지
- TS
- 정렬 알고리즘
- Javascript sort
- 자바스크립트 알고리즘
- 맨해튼거리
- 자바스크립트 배열
- next.js
- mysql스키마
- Python reverse
- 오블완
- MySQL
- node.js
- 깃허브
- 프로그래머스
- 장고 데코레이터
- JavaScript
- django decorator
- Javascript 정렬
- 자바스크립트 정렬
- 알고리즘
- isinstance vs type
- 프로그래머스 자바스크립트 풀이
- 장고 decorator
- binary search
- js 알고리즘
- 타입스크립트
- TypeScript
- Today
- Total
목록전체 글 (89)
FE PARADISE
decoratordecorator는 뷰 함수(또는 메서드)의 동작을 감싸서 추가 기능을 붙이는 문법 decorator의 기본 구조decorator는 함수를 인자로 받아 wrapper 함수로 인자로 들어온 함수를 감싸 반환한다.def decorator(func): def wrapper(*args, **kwargs): # before result = func(*args, **kwargs) # after return result return wrapper @decoratordef hello_world(): passhello_world = decorator(hello_world)이 둘은 같다. 사용 예시decorator 사용 전 😕view마다 ..
reverse이름만 보면 뭘 반대로 뒤집는 느낌이 들지만 뭔가 배열의 정렬을 반대로 뒤집어 반환한다거나 문자열을 뒤집어주는 역할을 하지 않음.reversed([1, 2, 3]) # → [3, 2, 1]그런 역할을 하는 게 Python 문법에 reversed라고 있긴 함. 그건 나중에 알아보자.?? 그래서 Django reverse가 뭔데보통 정신병이 나에게 온다하지만 reverse를 이용하면내가 정신병에게 간다 URL → Viewpath('hello/', views.hello_world, name='hello_world') View name → URL# urls.pyurlpatterns = [ path('hello_world/', HelloWorldView, name='hello_world'), ..
isinstance객체가 특정 타입인지 확인하는 함수반환 값: True / Falseisinstance((1, 2, 3), tuple) # Trueisinstance("Mac", (int, float, str)) # True 사용 예시def foo(x): if not isinstance(x, str): raise TypeError("난 str만 받아🤨") type이랑 똑같은 거 아님? (아님) 🧆class SexyFood: passclass Duzzoncoo(SexyFood): # Duzzoncoo는 SexyFood의 속성을 상속 받은 하위 타입 passcookie = Duzzoncoo()type(cookie) # type(cookie) == SexyFood # Fals..
코드 확인하기 👀interface Stack { readonly size: number; push(value: string): void; pop(): string;}type StackNode = { readonly value: string; readonly next?: StackNode;};class StackImpl implements Stack { private _size: number = 0; private head?: StackNode; get size() { return this._size; } push(value: string) { const node: StackNode = { value, next: this.head }; this.head = node; ..