팩토리 패턴, 프로토타입
🔷 팩토리 패턴 function 카드공장 (name, att, hp){ return{ name:name, att:att, hp:hp, type:'카드', attack:function(){}, defend:function(){}, }; } let card = 카드공장('토끼',10,10); card //{name: "토끼", att: 10, hp: 10, type: "카드", attack: ƒ, …} //att: 10 //attack: ƒ () //defend: ƒ () //hp: 10 //name: "토끼" //type: "카드" //__proto__: Object let card2 = 카드공장('거북이',20,20); card2 //{name: "거북이", att: 20, hp: 20, type: "카..