Objects Cheat Sheet / JavaScript

Yoon·2021년 8월 19일
0

> object(객체)

자바 스크립트는 객체 기반의 스크립트 언어.
객체의 구성요소로는 property , method가 존재한다. (객체는 이들을 감싸고 있는 껍데기와 같은 느낌으로 이해!)
property : key , value 한쌍으로 이루어짐 / 데이터
key : 빈 문자열을 포함하는 모든 문자열 또는 symbol값
value : 모든 값
method : 데이터를 참조하고 조작할 수 있는 동작(behavior)

자바스크립트의 객체는 객체 지향의 상속을 구현하기 위해 프로토타입(prototype)이라고 불리는 객체의 프로퍼티와 메소드를 상속 받을 수 있다. 이 프로토 타입은 타 언어와 구별되는 중요한 개념.

Object Literal Notaion:

var object = {};

Bracket Notation:

object['property']=value;

Dot Notation

object.property = value;

Object Constructor Functions (생성자 함수)

// 빈 객체 생성
var person = new Object();
// 프로퍼티 추가
person.name = 'lee';
person.gender = 'male';

console.log(typeof person); // object
console.log(person); // {name:"lee", gender:"male"}
//1. 생성자 함수를 작성하여 객체를 정의.
//2. new 키워드를 사용하여 객체의 인스턴스 생성
function book (page, writer, years, novel, codeNumnber){
    this.book = book;
    this.writer = writer;
    this.years = years;
    this.novel = novel;
    this.codeNumnber = codeNumnber;
}

var book1 = new Book(500, 'yoon', '1995', true, 56);
console.log(book1); 
//

JavaScript Beginner Bootcamp (2021)

23개의 댓글

comment-user-thumbnail
2022년 7월 26일

You must be a master coder. Thanks for sharing. https://flixdle.com/

답글 달기
comment-user-thumbnail
2022년 8월 2일

코드 작성 전문가여야 합니다. 공유해주셔서 감사합니다.
https://geometry-dash.io

답글 달기
comment-user-thumbnail
2022년 9월 10일

It is great to read https://fallguys2.co/ this article it means a lot to us in this life. It teaches us humans that humans must https://wordleonline.com/ love nature to make this life more colorful.

답글 달기
comment-user-thumbnail
2022년 10월 5일

공유해주셔서 감사합니다. https://backroomsgame.io

답글 달기
comment-user-thumbnail
2022년 10월 11일

You should be an expert in writing code. I am grateful that you shared. https://basketball-stars.co/

답글 달기
comment-user-thumbnail
2022년 10월 17일

It's as if you mastered the material, but neglected to factor in the audience. Maybe you need to look at things from other perspectives. https://fnfmod.co

답글 달기
comment-user-thumbnail
2022년 11월 9일

The fact that I read this article of yours https://1001games.io/
is both amazing and fortunate for me because it made me aware of many things that have taught me and many others to live more sociably.

답글 달기
comment-user-thumbnail
2022년 12월 23일

공유해주셔서 감사합니다 https://word-hurdle.com/

1개의 답글
comment-user-thumbnail
2023년 2월 2일

The information you offered astounded me. I learned a lot from your piece, and I will surely read more of your writing in the future. unblocked gamez

답글 달기
comment-user-thumbnail
2023년 2월 14일

I've been following your advice and having a lot of fun with https://trapthemouse.com/ because of it.

답글 달기
comment-user-thumbnail
2023년 6월 29일

The keys in key-value pairs for JavaScript objects (or Symbols in ES6+) are always strings https://mysingingmonsters.io/

답글 달기
comment-user-thumbnail
2023년 12월 15일

OMG You shared the information I really needed! Thank you very much! We really need so much useful information. I'd like you to share more! I also want to share https://babyyellow.io to you!

답글 달기
comment-user-thumbnail
2024년 10월 10일

I would like to express my gratitude for the thoughtful contribution you have made regarding this topic. Including the author name or website name is something I find admirable as it is really important in this day and age. https://papasfreezeriagame.io

답글 달기
comment-user-thumbnail
2024년 10월 21일

읽은 후에 나는 많은 이익을 얻었다。Sprunked, Abgerny, Abgerny, Colorbox Mustard, Sprunki Incredibox, Incredibox Mustard Game

답글 달기
comment-user-thumbnail
2024년 10월 30일

코드 작성 전문가여야 합니다. 공유해주셔서 감사합니다.
https://webfishing.pro/

답글 달기
comment-user-thumbnail
2024년 10월 30일

코드 작성 전문가여야 합니다. 공유해주셔서 감사합니다.
https://blockblastgames.com/

답글 달기
comment-user-thumbnail
2024년 11월 5일

코드 작성 전문가여야 합니다. 공유해주셔서 감사합니다.
https://sprunkiphase.co/
https://sprinkleincredibox.com/

답글 달기
comment-user-thumbnail
2024년 11월 22일

공유해주셔서 감사합니다. https://sprunkisinneredition.net/

답글 달기
comment-user-thumbnail
2024년 11월 25일

You must be a master coder. Thanks for sharing.
https://sprunkilove.com/

답글 달기
comment-user-thumbnail
2024년 11월 28일

I appreciate all the useful information you have provided. I hope you will continue to send as many thought provoking letters as possible to everyone in the future. https://unoonlinefree.com

답글 달기
comment-user-thumbnail
2024년 12월 2일

You must be a master coder.https://www.powersmart-akku.de

답글 달기
comment-user-thumbnail
2024년 12월 10일
답글 달기

관련 채용 정보