Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 컨디셔널 렌더링
- react
- CSS
- SCSS
- createGlobalStyle
- ngrok설치
- getModifierState
- nextjs .env
- input type=file
- styled components
- typescript react
- react env
- fetch
- ngrok실행
- API 토큰
- github io
- next.js css
- npm styled-reset
- nextjs 설치
- icon
- nextjs
- rewrites
- API token
- git lab
- Git
- There isn’t anything to compare
- dart 변수
- bootstrap
- react typescript
- github
Archives
- Today
- Total
목록생성자함수 (1)
꾸준히 성장하는 개발자

function User(first, last){ this.firstName=first this.lastName=last } const heropy =new User('Heropy', 'Park') console.log(heropy) 생성자 함수 new 키워드를 사용하여 함수를 호출하게 되면 return문이 없어도 새로운 객체를 반환시킨다. 그리고 생성자 함수가 일반 함수와 구분이 안되기 때문에 이를 구분하기위해 new와 함께 쓰이는 함수를 이름을 첫번째 글자를 대문자로 작성한다. 함수 이름의 첫번째 글자가 대문자이면 이 함수는 생성자 함수라고 생각하면 된다.
JavaScript
2022. 4. 15. 22:13