코락 CoRock
코딩하는 락스타
코락 CoRock
  • 분류 전체보기 (393)
    • frameworks (19)
      • spring (19)
      • spring-boot (0)
      • testing (0)
    • languages (94)
      • java (39)
      • kotlin (0)
      • python (42)
      • r (13)
    • libraries (0)
    • programming (239)
      • android (13)
      • c (17)
      • cpp (22)
      • database (18)
      • design-pattern (4)
      • data-structures (11)
      • git (8)
      • hadoop (6)
      • html-css (7)
      • issue (4)
      • javascript (26)
      • jsp (34)
      • os (29)
      • php (6)
      • preferences (19)
      • etc (15)
    • discography (37)
      • k-pop (18)
      • pop (19)
    • blog (3)

블로그 메뉴

  • Programming
  • Java
  • JavaScript
  • Discography
  • K-Pop Songs
  • Pop Songs
  • Blog
  • Guestbook

공지사항

인기 글

태그

  • 파이썬
  • 자바스크립트
  • javascript
  • oracle
  • Java
  • CentOS
  • python
  • linux
  • r
  • Spring
  • jsp
  • Android

최근 댓글

최근 글

티스토리

반응형
hELLO · Designed By 정상우.
코락 CoRock

코딩하는 락스타

[JavaScript] 자바스크립트 객체
programming/javascript

[JavaScript] 자바스크립트 객체

2018. 4. 5. 20:44
반응형

2. 자바스크립트 객체


2.1 자바스크립트의 객체


2.1.1 내장 객체 : document, window, screen, browser 등

Date : 날짜와 시간 작업

Number : 수치형 데이터

String : 문자열 관련

Math : 수학 연산

Array : 배열


2.2.2 사용자 정의 객체

- 객체 상수로부터 객체 생성

var myCar = {

  model: "520d",

  speed: 60,

  color: "red",

  break: function() { this.speed -= 10; }

  accel: function() { this.speed += 10; }

};

myCar.color = "yellow";

myCar.break();


- 생성자 함수를 이용한 객체 생성

function Car(model, speed, color) {

  this.model = model;

  this.speed = speed;

  this.color = color;

  this.break = function() {

    this.speed -= speed;

  }

  this.accel = function() {

    this.speed += speed;

  }

}

var myCar = new Car("520d", 60, "white");

myCar.color = "yellow";

myCar.break();


2.2 실습예제


2.2.1 date1.html

2.2.2 date2.html

2.2.3 date3.html

2.2.4 date4.html

2.2.5 number1.html

2.2.6 number2.html

2.2.7 match.html

2.2.8 math1.html

2.2.9 math2.html

2.2.10 math3.html

2.2.11 array1.html

2.2.12 array2.html (요일 표시)

2.2.13 sort.html

2.2.14 try.html

2.2.15 screen.html

2.2.16 custom_type.html (사용자 정의 자료형)

2.2.17 calendar.html

반응형
저작자표시 비영리 변경금지 (새창열림)
    'programming/javascript' 카테고리의 다른 글
    • [JavaScript] Ajax, XML, JSON
    • [JavaScript] 자바스크립트 객체
    • [JavaScript] DOM과 이벤트 처리, 입력검증
    • [JavaScript] 자바스크립트 기초 문법
    코락 CoRock
    코락 CoRock
    A COder dreaming of being a ROCKstar

    티스토리툴바