Object.create()

Object.create() __proto__ ๋Œ€์‹ ์— 'Object.create()' ๋ฅผ ์‚ฌ์šฉํ•ด์„œ prototype link(๋ช…ํ™•ํ•œ ์ƒ์†๊ด€๊ณ„)๋ฅผ ์ง€์ •ํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค. let lee = Object.create(kim); kim์„ ๋ถ€๋ชจ๋กœ ํ•˜๋Š” ์ž์‹๊ฐ์ฒด lee๋ฅผ ๋งŒ๋“ค์–ด์ค˜ let superObj = {superVal:'super'} //let subObj = {subVal:'sub'} //subObj.__proto__ = superObj; let subObj = Object.create(superObj);// superObj๋ฅผ ๋ถ€๋ชจ๋กœ ํ•˜๋Š” ์ƒˆ๋กœ์šด ๊ฐ์ฒด,๋ณด๋‹ค prototype link(๋ช…ํ™•ํ•œ ์ƒ์†๊ด€๊ณ„)๋ฅผ ํ™•๋ฆฝ! subObj.subVal = 'sub'; //์ฃผ์„์ฒ˜๋ฆฌ๋ฅผ ํ•œ ์œ„์˜ ์ฝ”๋“œ์™€ ๋˜‘๊ฐ™์ด ๋™์ž‘ console.lo..
becky(์ง€์€)
'Object.create()' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก