본문 바로가기

카테고리 없음

javascript에서 변수에 있는 값과 변수에 있는 함수값 출력

const player = {
    name : "canyi",
    sayHello: function(other_name){
        console.log("hello!" + other_name);
    }
};

console.log(player.name)          //canyi
player.sayHello("check");         //hello