4주차의 멋

이도현·2023년 5월 10일
0

UDR

목록 보기
13/22
  • 화살표 함수

function sum(a, b) {
	return a + b;
};

=

let sum = function(a, b) {
  return a + b;
};

=

let sum = (a, b) => a + b;
  • 객체 설정

const man = {
  age : 13,
  name : 'elly',
  height : 173,
  func1 : function() {
    console.log("함수 테스트");
  },
  func2 : function(age, height) {
    console.log(age+height);
  },
  hascompany : true,
  isCEO : function() {
    if (this.hascompany) {
      console.log("창업가입니다.");
    }
  }
}
man.isCEO()
  • 객체 추가 및 삭제

man.major ="Electronics and information"; 
// 객체 항목 추가
delete man.major;
// 객체 항목 삭제
  • 테킷 수강 인증

profile
안녕하세요

0개의 댓글

관련 채용 정보