{"id":414,"date":"2026-06-26T13:35:24","date_gmt":"2026-06-26T13:35:24","guid":{"rendered":"https:\/\/aabbee.cafe24.com\/?p=414"},"modified":"2026-06-26T14:02:46","modified_gmt":"2026-06-26T14:02:46","slug":"5-%ea%b0%9d%ec%b2%b4","status":"publish","type":"post","link":"https:\/\/coalacoding.com\/?p=414","title":{"rendered":"5-\uac1d\uccb4"},"content":{"rendered":"<p><Accordion title=\"\ubaa9\ucc28\"><\/Accordion><\/p>\n<h2>1-\uac1c\ub150<\/h2>\n<h3>1-1-\uc815\uc758<\/h3>\n<p>0\uac1c \uc774\uc0c1\uc758 \ud504\ub85c\ud37c\ud2f0(property:\uc18d\uc131) \uc758 \uc9d1\ud569.<\/p>\n<pre><code class=\"language-javascript\">\ud654\uc0b4\ud45c\ud568\uc218\uc5d0\uc11c\ub294 \ud568\uc218\uc758 \ub809\uc2dc\uceec \uc2a4\ucf54\ud504\ub97c \uac00\ub974\ud0b4&quot;\nconst person = {\n  name: &#39;Kim&#39;,      \/\/ \ud504\ub85c\ud37c\ud2f0\n  age: 30,          \/\/ \ud504\ub85c\ud37c\ud2f0\n~~  greet: function () {         \/\/ \uba54\uc11c\ub4dc\n    return `Hello, I&#39;m ${this.name}`;\n  }\n~~greet() {         \/\/ \uba54\uc11c\ub4dc\n    return `Hello, I&#39;m ${this.name}`;\n  }\n};\n<\/code><\/pre>\n<p>\ud504\ub85c\ud37c\ud2f0\ub294 \ud0a4(key)\uc640 \uac12(value)\uc73c\ub85c \uad6c\uc131\ub428.<\/p>\n<ul>\n<li>\ud504\ub85c\ud37c\ud2f0: \uac1d\uccb4\uc758 \uc0c1\ud0dc\ub97c \ub098\ud0c0\ub0b4\ub294 \uac12<\/li>\n<li>\uba54\uc11c\ub4dc: \ud504\ub85c\ud37c\ud2f0\ub97c \ucc38\uc870\ud558\uace0 \uc870\uc791\ud560\uc218 \uc788\ub294 \ub3d9\uc791<\/li>\n<\/ul>\n<h2>2-\uac1d\uccb4\uc758 \uc0dd\uc131<\/h2>\n<h3>2-1-\uac1d\uccb4\ub9ac\ud130\ub7f4 <code>{ }<\/code><\/h3>\n<pre><code class=\"language-java\">const person = {\n  name: &quot;Kim&quot;,\n  age: 25,\n  greet () {\n    console.log(`Hello, my name is ${this.name}`);\n  }\n};\n\nperson.greet();\n<\/code><\/pre>\n<h3>2-2-Object \uc0dd\uc131\uc790\ud568\uc218<code> new Object()<\/code><\/h3>\n<pre><code class=\"language-java\">const person = new Object();\nperson.name = &quot;Kim&quot;;\nperson.age = 25;\nperson.greet = function() {\n  console.log(`Hello, my name is ${this.name}`);\n};\n\nperson.greet(); \n<\/code><\/pre>\n<h3>2-3-\uc0dd\uc131\uc790\ud568\uc218<\/h3>\n<pre><code class=\"language-java\">function Person(name, age) {\n  this.name = name;\n  this.age = age;\n  this.greet = function() {\n    console.log(`Hello, my name is ${this.name}`);\n  };\n}\n\nconst person1 = new Person(&quot;Kim&quot;, 25);\nperson1.greet();\n<\/code><\/pre>\n<h3>2-4-Object.create\uba54\uc11c\ub4dc<\/h3>\n<pre><code class=\"language-java\">const personPrototype = {\n  greet: function() {\n    console.log(`Hello, my name is ${this.name}`);\n  }\n};\n\nconst person = Object.create(personPrototype);\nperson.name = &quot;Kim&quot;;\nperson.age = 25;\n\nperson.greet(); \n<\/code><\/pre>\n<h3>2-5-\ud074\ub798\uc2a4<\/h3>\n<pre><code class=\"language-java\">class Person {\n  constructor(name, age) {\n    this.name = name;\n    this.age = age;\n  }\n\n  greet() {\n    console.log(`Hello, my name is ${this.name}`);\n  }\n}\n\nconst person = new Person(&quot;Kim&quot;, 25);\nperson.greet(); \n<\/code><\/pre>\n<h2>3-\ud504\ub85c\ud37c\ud2f0<\/h2>\n<h3>3-1-\uc694\uc18c<\/h3>\n<p>\uac1d\uccb4\ub294 \ud504\ub85c\ud37c\ud2f0\uc758 \uc9d1\ud569\uc774\uba70 \ud504\ub85c\ud37c\ud2f0\ub294 \ud0a4\uc640 \uac12\uc73c\ub85c \uad6c\uc131\ub41c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">const person = {\n\/\/\ud0a4\ub294 name, \uac12\uc740 kim\n  name: &quot;Kim&quot;,\n  age: 25,\n};\n<\/code><\/pre>\n<p>\ud504\ub85c\ud37c\ud2f0\uc758 \ud0a4\ub294 \ud504\ub85c\ud37c\ud2f0 \uac12\uc758 \uad6c\ubcc4\uc744 \uc704\ud55c \uc2dd\ubcc4\uc790\uc758 \uc5ed\ud560\uc744 \ud55c\ub2e4.<br \/>\n\ud0a4\uc758 \uc0dd\uc131\uc2dc \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uc2dd\ubcc4\uc790\uc758 \uaddc\uce59\uc744 \ub530\ub974\uc9c0 \uc54a\uc544\ub3c4 \ub418\ub098 \uadf8\ub7f4\uacbd\uc6b0 \u201c\u201d\ub85c \ubb36\uc5b4\uc11c \ud45c\uae30\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">const person = {\n  &quot;01&quot;: &quot;Kim&quot;,\n  &quot;\ub098\uc774&quot;: 25,\n  &quot;e-mail&quot;: &quot;qwer@qu.com&quot;\n};\n<\/code><\/pre>\n<p>\uc774\ub807\uac8c \uc120\uc5b8\ud55c \ud504\ub85c\ud37c\ud2f0\ub294 \ub300\uad04\ud638\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc811\uadfc\ud560\uc218 \uc788\ub2e4.<br \/>\n\uc810 \ud45c\uae30\ubc95\uc73c\ub85c \uc811\uadfc\uc2dc \ube84\uc148\uc5f0\uc0b0\uc790\ub85c \uc778\uc2dd\ud558\uac8c \ub418\ub294 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud558\ubbc0\ub85c \uc720\uc758\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre><code class=\"language-java\">console.log(person[&#39;e-mail&#39;]);\n<\/code><\/pre>\n<p>\ud0a4\ub294 \uc544\ub798\uc640 \uac19\uc774 \uc22b\uc790\uc640 \uc608\uc57d\uc5b4\ub97c \uc9c0\uc815\ud560\uc218 \uc788\ub2e4<\/p>\n<pre><code class=\"language-javascript\">const property = {\n  0: 1,\n  function: function(){\n    console.log(&#39;fun&#39;);\n  }\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/01-32.png\" alt=\"\"><\/p>\n<p>\uc22b\uc790\ub85c \uc9c0\uc815\ud55c \ud0a4\ub294 \uc554\ubb35\uc801\uc73c\ub85c \uc790\ub8cc\ud615\uc774 \ubb38\uc790\ud615\uc73c\ub85c \ubcc0\ud658\ub41c \uac83\uc774 \ud655\uc778\ub41c\ub2e4.<\/p>\n<h3>3-2-\uc811\uadfc<\/h3>\n<pre><code class=\"language-javascript\">const dot = {\n  name: &#39;me&#39;\n}\nconsole.log(dot.me);\nconsole.log(dot[&#39;me&#39;]);\n<\/code><\/pre>\n<p>\uc704\uc758 \uacbd\uc6b0 \ucc98\ub7fc \uc874\uc7ac \ud558\uc9c0 \uc54a\ub294 \ud0a4\uc5d0 \uc811\uadfc\ud574\ub3c4 \ucc38\uc870\uc624\ub958\uac00 \uc544\ub2cc undefined \uac00 \ubc18\ud658\ub418\ub294 \uc810\uc5d0 \uc720\uc758\ud574\uc57c \ud55c\ub2e4.<\/p>\n<hr>\n<p>\ud504\ub85c\ud37c\ud2f0\ub294 \ub450\uac00\uc9c0 \ubc29\ubc95\uc73c\ub85c \uc811\uadfc\ud560\uc218 \uc788\ub2e4.<\/p>\n<h4>*<em>3-2-1-<\/em>*<strong><code>. <\/code><\/strong>\ub9c8\uce68\ud45c \ud45c\uae30\ubc95(dot notation)<\/h4>\n<pre><code class=\"language-javascript\">const dot = {\n  name: &#39;me&#39;\n}\nconsole.log(dot.name);\n<\/code><\/pre>\n<h4><strong>3-2-2-**<strong><code>[]<\/code><\/strong><\/strong> **\ub300\uad04\ud638 \ud45c\uae30\ubc95(bracket notation)<\/h4>\n<pre><code class=\"language-javascript\">const dot = {\n  name: &#39;me&#39;\n}\nconsole.log(dot[&#39;name&#39;]);\n<\/code><\/pre>\n<p>\ud504\ub85c\ud37c\ud2f0\uc758 \ud0a4\uac00 \uc22b\uc790\uc778 \uacbd\uc6b0\ub294 \ub300\uad04\ud638 \uc811\uadfc\uc2dc \ub530\uc634\ud45c\ub97c \uc0dd\ub7b5\ud560\uc218 \uc788\ub2e4.<\/p>\n<h3>3-3-\uac31\uc2e0<\/h3>\n<pre><code class=\"language-java\">const dot = {\n  name: &#39;me&#39;,\n}\ndot.name=&#39;you&#39;\nconsole.log(dot.name);\n<\/code><\/pre>\n<p>\uc774\ubbf8 \uc874\uc7ac\ud558\ub294 \ud504\ub85c\ud37c\ud2f0\uc5d0 \uac12\uc744 \uc7ac\ud560\ub2f9 \ud558\uba74 \uac12\uc774 \uac31\uc2e0\ub41c\ub2e4.<\/p>\n<h3>3-4-\ub3d9\uc801\uc0dd\uc131<\/h3>\n<pre><code class=\"language-javascript\">dot.age = 20;\nconsole.log(dot);\ndot.gender=&quot;female&quot;;\nconsole.log(dot)\n<\/code><\/pre>\n<p>dot \uac1d\uccb4\uc5d0\ub294 age \ud504\ub85c\ud37c\ud2f0\uac00 \ucd94\uac00\ub418\uace0 \uac12\uc774 \ud560\ub2f9\ub418\uc5c8\ub2e4.<\/p>\n<h3>3-5-\uc0ad\uc81c<\/h3>\n<pre><code class=\"language-java\">const person = {\n  name: &#39;Kim&#39;\n}\nperson.age = 10;\ndelete person.age;\ndelete person.address;\n<\/code><\/pre>\n<p>person \uac1d\uccb4\ub294 name \ud504\ub85c\ud37c\ud2f0\uac00 \uc788\ub2e4.<br \/>\nage\ub97c \ub3d9\uc801\uc73c\ub85c \uc0dd\uc131\ud6c4 delete \ud0a4\uc6cc\ub4dc\ub85c \uc0ad\uc81c\ud55c\ub2e4.<br \/>\n\uc774\ud6c4 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294 address \ud0a4 \uc0ad\uc81c\uc2dc \uc624\ub958\uac00 \uc548\ub098\ub294 \uac83\uc744 \ud655\uc778\ud574\ubcf8\ub2e4<\/p>\n<h2>4-\uac1d\uccb4\ub9ac\ud130\ub7f4\uc758 \ud655\uc7a5\uae30\ub2a5<\/h2>\n<h3>4-1-\ud504\ub85c\ud37c\ud2f0 \ucd95\uc57d<\/h3>\n<pre><code class=\"language-javascript\">const x = 1, y = 2;\n\/\/const obj = { x: x, y: y }\nconst obj = { x, y }\nconsole.log(obj);\n<\/code><\/pre>\n<h3>4-2-\uacc4\uc0b0\ub41c \ud504\ub85c\ud37c\ud2f0\uba85<\/h3>\n<p>\ubb38\uc790\uc5f4\uc774\ub098 \ubb38\uc790\uc5f4\ub85c \ud3c9\uac00\ub418\ub294 \ud45c\ud604\uc2dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \ud504\ub85c\ud37c\ud2f0 \ud0a4\ub97c \ub3d9\uc801\uc0dd\uc131\ud560\uc218 \uc788\ub2e4.<br \/>\n\uc774\ub54c <code>[]<\/code> \ub97c \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">const prefix = &#39;prop&#39;\nlet i = 0;\nconst obj = {}\n\nobj[prefix + &#39;-&#39; + ++i] = i\nobj[`${prefix}-${++i}`] = i\nconsole.log(obj)\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/02-24.png\" alt=\"\"><\/p>\n<pre><code class=\"language-javascript\">{\n  const prefix = &#39;prop&#39;;\n  let i = 0;\n  const obj = {\n    [`${prefix}-${++i}`]: i,\n    [`${prefix}-${++i}`]: i,\n    [`${prefix}-${++i}`]: i,\n  }\n  console.log(obj);\n<\/code><\/pre>\n<h3>4-3-\uba54\uc11c\ub4dc \ucd95\uc57d<\/h3>\n<p>\ud504\ub85c\ud37c\ud2f0 \uac12\uc73c\ub85c \ud568\uc218\ub97c \ud560\ub2f9<\/p>\n<pre><code class=\"language-javascript\">{\n\/\/1\n  const obj = {\n    name: &quot;kim&quot;,\n    say: function () {\n      console.log(&#39;hi&#39; + this.name);\n\n    }\n  }\n  obj.say();\n}\n{\n\/\/2\n  const obj = {\n    name: &quot;kim&quot;,\n    say () {\n      console.log(&#39;hi&#39; + this.name);\n\n    }\n  }\n  obj.say();\n}\n<\/code><\/pre>\n<p>1\uc758 \uba54\uc11c\ub4dc\ub97c 2\ub85c \ucd95\uc57d\ud560\uc218 \uc788\ub2e4.<\/p>\n<h2>5-\uac1d\uccb4\uc758 \uc21c\ud68c<\/h2>\n<h3>5-1-<code>for~in<\/code><\/h3>\n<h3>5-2-<code>Object.key()<\/code><\/h3>\n<h3>5-3-<code>Object.entries()<\/code><\/h3>\n<h3>5-4-<code>Object.values()<\/code><\/h3>\n<h2>6-\uac1d\uccb4\uc758 \ubcd1\ud569\uacfc\ubcf5\uc0ac<\/h2>\n<blockquote>\n<p><strong>Info<\/strong>: \uc595\uc740\ubcf5\uc0ac\u2192\uae4a\uc740\ubcf5\uc0ac<\/p>\n<\/blockquote>\n<p>  \uae4a\uc740\ubcf5\uc0ac\u219b\uc595\uc740\ubcf5\uc0ac<br \/>\n\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc758 7\uac00\uc9c0 \uc790\ub8cc\ud615\uc740 \ud06c\uac8c \uc6d0\uc2dc\ud0c0\uc785(primitive type)\uacfc \uac1d\uccb4\ud0c0\uc785(object\/reference type)\uc73c\ub85c \ub098\ub20c\uc218 \uc788\ub2e4. <a href=\"\/103725808c2680599a2dec7f64c8cfa1#a03910b7615b470497b13f3ce69d3a0a\">\uc790\ub8cc\ud615\uc758 \uad6c\ubd84\ud45c<\/a>\ub97c \ucc38\uc870\ud558\uc790.<\/p>\n<ul>\n<li><strong>\uc6d0\uc2dc \ud0c0\uc785(Primitive Type)<\/strong>\uc740 \uac12\uc774 \ubcc0\uacbd \ubd88\uac00\ub2a5(immutable) \ud558\uba70, \ubcc0\uc218\uc5d0 \uc9c1\uc811 \uc800\uc7a5\ub41c\ub2e4.<\/li>\n<li><strong>\uac1d\uccb4 \ud0c0\uc785(Object Type)<\/strong>\uc740 \uac12\uc774 \ubcc0\uacbd \uac00\ub2a5(mutable) \ud558\uba70, \uba54\ubaa8\ub9ac \uc8fc\uc18c(\ucc38\uc870)\ub85c \uc800\uc7a5\ub41c\ub2e4..<\/li>\n<\/ul>\n<pre><code class=\"language-javascript\">\/\/const \ud0a4\uc6cc\ub4dc\ub97c \uc0ac\uc6a9\ud55c \ubcc0\uc218\ub294 \uac12\uc758 \uc7ac\ud560\ub2f9 \ubd88\uac00\nconst o = {}\n\/\/\uadf8\ub7ec\ub098 \uac1d\uccb4\ub294 \ubcc0\uacbd\ud560\uc218 \uc788\ub2e4.\no.a = 1\nconsole.log(o);\n<\/code><\/pre>\n<h3>6-1-\ubb38\uc790\uc5f4\uacfc \ubd88\ubcc0\uc131<\/h3>\n<p>\ubb38\uc790\uc5f4\uc740 \ub2e4\ub978 \uc6d0\uc2dc\ud0c0\uc785\uacfc \ub2e4\ub978 \ud2b9\uc9d5\uc774 \uc788\ub2e4.<br \/>\n\ubb38\uc790\uc5f4\uc774\ub780 0\uac1c \uc774\uc0c1\uc758 \ubb38\uc790\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uc9d1\ud569\uc744 \uc758\ubbf8\ud558\uace0 1\uac1c\uc758 \ubb38\uc790\ub294 \ub300\ub7b5 2byte\uc758 \uba54\ubaa8\ub9ac\uacf5\uac04\uc5d0 \uc800\uc7a5\ub41c\ub2e4.<br \/>\n\uc22b\uc790\uc758 \uacbd\uc6b0 1\ub3c4 10000000\ub3c4 \uac19\uc740 8byte\uc758 \uacf5\uac04\uc744 \ucc28\uc9c0\ud55c\ub2e4.<br \/>\n\uadf8\ub7ec\ub098 \ubb38\uc790\uc5f4\uc740 \ub300\ub7b5 \u201c1\u201d\uc740 2byte \u201c10\u201d\uc740 4byte \uac00 \ud544\uc694\ud558\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">var str = &quot;hello&quot;;\nstr = &quot;world&quot;\n<\/code><\/pre>\n<ol>\n<li><\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/03-16.png\" alt=\"\"><\/p>\n<ol>\n<li><\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/04-14.png\" alt=\"\"><\/p>\n<p>  str \uc774\ub77c\ub294 \uc2dd\ubcc4\uc790\uc5d0 \uac12\uc774 \uc7ac\ud560\ub2f9 \ub418\ub294\uac83\uc774 \uc544\ub2c8\ub77c \uac12\uc774 \uc800\uc7a5\ub418\ub294 \uba54\ubaa8\ub9ac\uac00 \uc0dd\uc131\ub418\uace0 \uc2dd\ubcc4\uc790\uac00 \uac00\ub974\ud0a4\ub294 \uba54\ubaa8\ub9ac\uc8fc\uc18c\uac00 \ubc14\ub010\ub2e4.<\/p>\n<p>\ubb38\uc790\uc5f4\uc740 \uc720\uc0ac\ubc30\uc5f4\uac1d\uccb4\ub85c \ucde8\uae09\ub418\uc5b4 \ubc30\uc5f4\uacfc \uc720\uc0ac\ud558\uac8c \uac01 \ubb38\uc790\uc5d0 \uc811\uadfc\ud560\uc218 \uc788\ub2e4.<br \/>\n<code>console.log(str[1]);<\/code><br \/>\n\uadf8\ub7ec\ub098 \uc6d0\uc2dc\ud0c0\uc785\uc774\ubbc0\ub85c \uac12\uc740 \ubd88\ubcc0\uc131\uc744 \uc720\uc9c0\ud558\uae30 \ub54c\ubb38\uc5d0 \uc544\ub798\uc758 \ucf54\ub4dc\ub294 \uac12\uc774 \uc7ac\ud560\ub2f9 \ub418\uc9c0 \uc54a\ub294\ub2e4<\/p>\n<pre><code class=\"language-javascript\">str[1] = &quot;a&quot;\nconsole.log(str[1]);\n<\/code><\/pre>\n<h3>6-2-\ubcf5\uc0ac(Copy)<\/h3>\n<h4>6-2-1-\ucc38\uc870(Reference)<\/h4>\n<ol>\n<li>\uc544\ub798\uc640 \uac19\uc740 \ud615\ud0dc\uc758 \uc911\ucca9\ub41c \uac12\uc744 \uc0b4\ud3b4\ubcf4\uc790.<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">const y = [1, 2, 3, [11, 12, 13]];\n<\/code><\/pre>\n<ol>\n<li>\ubcc0\uc218_y \uc5d0 y\ub97c \ubcf5\uc0ac\ud558\uace0 \ucd9c\ub825\ud55c\ub2e4<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">const _y = y;\nconsole.log(`\uc6d0\ubcf8:${y}\/\/${y === _y} `);\nconsole.log(`\ubcf5\uc0ac_y:${_y}`);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/05-12.png\" alt=\"\"><\/p>\n<ol>\n<li>\ub370\uc774\ud130\ub97c \ubc14\uafb8\uace0 \ucd9c\ub825\uac12\uc744 \ud655\uc778\ud55c\ub2e4.<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">_y[0] = 5;\n_y[3][0] = 105;\nconsole.log(`\uc6d0\ubcf8:${y}\/\/${y === _y} `);\nconsole.log(`\ubcf5\uc0ac_y:${_y}`);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/06-12.png\" alt=\"\"><\/p>\n<p>  _y \uc758 \uac12\uc744 \ubcc0\uacbd \ud558\uc600\ub294\ub370 \uc6d0\ubcf8\ub370\uc774\ud130\ub3c4 \ubc14\ub00c\uc5c8\ub2e4.<br \/>\n<strong>\ucc38\uc870\uc5d0 \uc758\ud55c \uc804\ub2ec<\/strong>\uc740 \uc644\uc804\ud788 \ub3d9\uc77c\ud55c \uba54\ubaa8\ub9ac \uc8fc\uc18c\ub97c \uacf5\uc720\ud558\ubbc0\ub85c <strong>\ud55c\ucabd\uc744 \uc218\uc815\ud558\uba74 \ub2e4\ub978 \ucabd\ub3c4 \uc989\uc2dc \ubcc0\uacbd\ub41c\ub2e4 <\/strong><\/p>\n<h4>6-2-2-\uc595\uc740\ubcf5\uc0ac(Shallow Copy)<\/h4>\n<ol>\n<li>\ubcc0\uc218 __y \uc5d0 y\ub97c \uc595\uc740\ubcf5\uc0ac\ub85c \ud560\ub2f9\ud574\ubcf4\uc790<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">const __y = [...y];\nconsole.log(`\uc6d0\ubcf8:${y}\/\/${y === __y} `);\nconsole.log(`\ubcf5\uc0ac...y:${__y}`);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/07-10.png\" alt=\"\"><\/p>\n<ol>\n<li>\ub370\uc774\ud130\ub97c \ubcc0\uacbd\ud574\ubcf4\uc790<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">__y[0] = &quot;\ud83d\ude18&quot;;\n__y[3][0] = &quot;abc&quot;;\n\nconsole.log(`\uc6d0\ubcf8:${y}\/\/${y === __y} `);\nconsole.log(`\ubcf5\uc0ac...y:${__y}`);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/08-9.png\" alt=\"\"><\/p>\n<p><strong>\uc595\uc740 \ubcf5\uc0ac<\/strong>\ub294** \ucd5c\uc0c1\uc704 \ub808\ubca8\uc758 \uc18d\uc131<strong>\uc744 \uc0c8\ub85c\uc6b4 \uba54\ubaa8\ub9ac \uacf5\uac04\uc5d0 \ubcf5\uc0ac\ud558\ubbc0\ub85c <strong>\uac12\uc774 \ubcc0\uacbd\ub418\uc9c0 \uc54a\ub294\ub2e4.<\/strong><br \/>\n\uadf8\ub7ec\ub098 <strong>\uc911\ucca9\ub41c \uac1d\uccb4<\/strong>\uc758 \uc218\uc815\uc2dc<\/strong> \uc6d0\ubcf8\ub3c4 \ubc14\ub010\ub2e4**.<\/p>\n<p><Accordion title=\"\uc595\uc740\ubcf5\uc0ac \ubc29\ubc95\"><br \/>\n&#8211; \uc2a4\ud504\ub808\ub4dc \uc5f0\uc0b0\uc790 (`{ &#8230;original }`)<br \/>\n&#8211; `Object.assign({}, original)`<br \/>\n&#8211; `Array.from()`<br \/>\n&#8211; `slice()` (\ubc30\uc5f4\uc758 \uacbd\uc6b0)<br \/>\n<\/Accordion><\/p>\n<h4>6-2-3-\uae4a\uc740\ubcf5\uc0ac(Deep Copy)<\/h4>\n<ol>\n<li>\ubcc0\uc218 deepY \uc5d0 y\ub97c \uae4a\uc740\ubcf5\uc0ac \ud574\ubcf4\uc790<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">const deepY = JSON.parse(JSON.stringify(y));\nconsole.log(`\uc6d0\ubcf8:${y}`);\nconsole.log(`deepY:${deepY}`);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/09-7.png\" alt=\"\"><\/p>\n<ol>\n<li>\uac12\uc744 \ubc14\uafd4\ubcf4\uc790<\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">deepY[0] = &#39;12&#39;;\ndeepY[3][0] = 12;\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/10-6.png\" alt=\"\"><\/p>\n<p><strong>\uae4a\uc740\ubcf5\uc0ac<\/strong>\ub294 \uc911\ucca9\ub370\uc774\ud130\uae4c\uc9c0 \uc0c8\ub85c\uc6b4 \uba54\ubaa8\ub9ac \uacf5\uac04\uc5d0 \uc800\uc7a5\ud558\ubbc0\ub85c \uc644\uc804\ud55c<strong> \ub370\uc774\ud130 \ub3c5\ub9bd\uc131\uc774 \ubcf4\uc7a5<\/strong>\ub41c\ub2e4.<\/p>\n<p><Accordion title=\"\uae4a\uc740\ubcf5\uc0ac\ubc29\ubc95\"><br \/>\n1. `npm i lodash`<br \/>\n1. <\/p>\n<pre><code class=\"language-javascript\">const _ = require(&#39;lodash&#39;);\nconst c2 = _.cloneDeep(y);\nconsole.log(c2 === y);\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<blockquote>\n<p><strong>Info<\/strong>: \uc595\uc740\ubcf5\uc0ac\uc640 \uae4a\uc740\ubcf5\uc0ac\ub85c \uc0dd\uc131\ub41c \uac1d\uccb4\ub294 \uc6d0\ubcf8\uacfc\ub294 \ub2e4\ub978 \uac1d\uccb4\ub2e4.<\/p>\n<\/blockquote>\n<ul>\n<li>\uac1d\uccb4\uc758 \uac12\uc774 \uc911\ucca9\ub41c \uacbd\uc6b0\n<ul>\n<li>\uc595\uc740\ubcf5\uc0ac\u2192\ucc38\uc870\uac12 \ubcf5\uc0ac<\/li>\n<li>\uae4a\uc740\ubcf5\uc0ac\u2192\uc911\ucca9\ub41c \uac1d\uccb4\uae4c\uc9c0 \ubaa8\ub450 \ubcf5\uc0ac<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>7-\ud504\ub85c\ud37c\ud2f0 \uc5b4\ud2b8\ub9ac\ubdf0\ud2b8<\/h2>\n<blockquote>\n<p><strong>Info<\/strong>: <strong>\ub0b4\ubd80\uc2ac\ub86f(internal slot), \ub0b4\ubd80 \uba54\uc11c\ub4dc(internal method)<\/strong><\/p>\n<\/blockquote>\n<ul>\n<li>\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc758 \uad6c\ud604 \uc54c\uace0\ub9ac\uc998 \uc124\uba85\uc744 \uc704\ud574 ECMAscript \uc0ac\uc591\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \uc758\uc0ac\ud504\ub85c\ud37c\ud2f0(pseudo property) , \uc758\uc0ac \uba54\uc11c\ub4dc(pseudo method)<\/li>\n<li><a href=\"https:\/\/262.ecma-international.org\/15.0\/index.html?_gl=1*m6x6he*_ga*MTY0MTE3NTY1OS4xNzQyMTE1NTI3*_ga_TDCK4DWEPP*MTc0MjExNTUyNy4xLjEuMTc0MjExNTYwMi4wLjAuMA..#sec-property-attributes\">\ud45c\uc900\uc0ac\uc591 \ubb38\uc11c\uc5d0 <\/a>\uc774\uc911 \ub300\uad04\ud638(<code>[[\u2026]]<\/code>) \ub85c \ud45c\uc2dc\ub41c \uac83\uc774 \ub0b4\ubd80\uc2ac\ub86f\uacfc \ub0b4\ubd80 \uba54\uc11c\ub4dc \uc774\ub2e4.<\/li>\n<\/ul>\n<h3>*<em>7-1-*<em>\ub370\uc774\ud130\uc18d\uc131\uc124\uba85\uc790 <strong><code>defineProperty<\/code><\/strong><\/em>*,<\/em>*<strong><code>defineProperties<\/code><\/strong><\/h3>\n<blockquote>\n<p><strong>Info<\/strong>: \uc815\uc758: \uac1d\uccb4 \ub370\uc774\ud130 \uc18d\uc131\uc744 \uc124\uba85\ud558\ub294 \uac83<\/p>\n<\/blockquote>\n<blockquote>\n<p>\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uc5d4\uc9c4\uc740 \ud504\ub85c\ud37c\ud2f0\ub97c \uc0dd\uc131\ud560 \ub54c \ud504\ub85c\ud37c\ud2f0\uc758 \uc0c1\ud0dc\ub97c \ub098\ud0c0\ub0b4\ub294 \ud504\ub85c\ud37c\ud2f0 \uc5b4\ud2b8\ub9ac\ubdf0\ud2b8\ub97c \uae30\ubcf8\uac12\uc73c\ub85c \uc790\ub3d9\uc815\uc758\ud55c\ub2e4.  <\/p>\n<\/blockquote>\n<pre><code>\ud504\ub85c\ud37c\ud2f0\uc758 \uc0c1\ud0dc\ub780 \ud504\ub85c\ud37c\ud2f0\uc758 \uac12, \uc218\uc815\/\uc5f4\uac70\/\uc7ac\uc815\uc758 \uc5ec\ubd80\ub97c \ub9d0\ud55c\ub2e4. \n<\/code><\/pre>\n<ul>\n<li>\ud50c\ub798\uadf8 \uc885\ub958<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>\uc885\ub958<\/th>\n<th>\uc124\uba85<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>value<\/td>\n<td>\uac12<\/td>\n<\/tr>\n<tr>\n<td>writable<\/td>\n<td>\uc218\uc815\uac00\ub2a5\uc5ec\ubd80<\/td>\n<\/tr>\n<tr>\n<td>enumerable<\/td>\n<td>\uc5f4\uac70\uac00\ub2a5\uc5ec\ubd80<\/td>\n<\/tr>\n<tr>\n<td>configurable<\/td>\n<td>\uc7ac\uc815\uc758\uac00\ub2a5\uc5ec\ubd80<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><strong>7-1-1-****<code>Object.getOwnPropertyDescriptors<\/code><\/strong><\/h4>\n<p>\uac1d\uccb4\uc758 \ubaa8\ub4e0 \ud504\ub85c\ud37c\ud2f0\ub97c \ubc18\ud658\ud55c\ub2e4<\/p>\n<pre><code class=\"language-javascript\">const obj = {\n  a: 1,\n  b: 2,\n  c: 3,\n}\nconsole.log(Object.getOwnPropertyDescriptors(obj));\n<\/code><\/pre>\n<h4><strong>7-1-2-****<code>Object.getOwnPropertyDescriptor()<\/code><\/strong><\/h4>\n<p>\uc9c0\uc815\ud55c \ud504\ub85c\ud37c\ud2f0\ub97c \ubc18\ud658\ud55c\ub2e4<\/p>\n<pre><code class=\"language-javascript\">const obj = {\n  a: 1,\n  b: 2,\n  c: 3,\n}\nconsole.log(Object.getOwnPropertyDescriptor(obj,&#39;a&#39;));\n<\/code><\/pre>\n<h4>7-1-3-<strong><code>Object.defineProperty()<\/code><\/strong><\/h4>\n<p><a href=\"\/1b1725808c2680498652e0eb5b7d0f72#1b6725808c26806ab90fc19cd11e72dd\">\ud50c\ub798\uadf8\ub85c <\/a>\ud504\ub85c\ud37c\ud2f0\uc758 \uc18d\uc131\uc758 \uc4f0\uae30 \uad8c\ud55c\uc744 \uc9c0\uc815\ud55c\ub2e4<\/p>\n<pre><code class=\"language-javascript\">const user = {}\nObject.defineProperty(user, &#39;u_id&#39;, { value: &#39;member&#39; })\nconsole.log(Object.getOwnPropertyDescriptors(user));\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/11-6.png\" alt=\"\"><\/p>\n<pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;ko&quot;&gt;\n\n&lt;head&gt;\n  &lt;meta charset=&quot;UTF-8&quot;&gt;\n  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n  &lt;title&gt;Document&lt;\/title&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n  &lt;script&gt;\n    const user = {}\n    Object.defineProperty(user, &#39;name&#39;, {\n      value: &#39;old&#39;,\n      writable: false, \/\/\uc218\uc815\uc5ec\ubd80\n      enumerable: true, \/\/\uc21c\ud68c\uac00\ub2a5\uc5ec\ubd80\n      configurable: true\/\/ \uc124\uc815(\uc0ad\uc81c\uac00\ub2a5) \ubcc0\uacbd\uc5ec\ubd80\n    })\n    user.name= &#39;new&#39;\n\n    console.log(Object.getOwnPropertyDescriptors(user));\n  &lt;\/script&gt;\n&lt;\/body&gt;\n\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>\ucf54\ub4dc\ub7ec\ub108\uc5d0\uc11c\ub294 \uc624\ub958\uac00 \ub0a0\uc218 \uc788\uc73c\ubbc0\ub85c html \ubb38\uc11c\ub85c \uc791\uc131\ud558\uc5ec \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c \ud14c\uc2a4\ud2b8\ud55c\ub2e4.<\/p>\n<h4>7-1-3-1-writable<\/h4>\n<p><code>user.name= &#39;new&#39; <\/code>\uac12 \ubcc0\uacbd\uc548\ub428<\/p>\n<h4>7-1-3-2-enumerable<\/h4>\n<p>\uac1d\uccb4\uc790\ub8cc\ud615\uc744 \uc21c\ud68c\ud560\ub54c\ub294 for~in \uc744 \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">    const user = {\n      name: &#39;abc&#39;,\n      age: &#39;20&#39;,\n      rule: &#39;guest&#39;,\n    }\n    Object.defineProperty(user, &#39;name&#39;, {\n      writable: false, \/\/\uc218\uc815\uc5ec\ubd80\n      enumerable: false, \/\/\uc21c\ud68c\uac00\ub2a5\uc5ec\ubd80\n      configurable: false\/\/ \uc124\uc815(\uc0ad\uc81c\uac00\ub2a5) \ubcc0\uacbd\uc5ec\ubd80\n    })\n    for (let key in user) {\n      const textNode = document.createTextNode(key);\n      document.body.appendChild(textNode);\n    }\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/12-5.png\" alt=\"\"><\/p>\n<p><code> enumerable: true,<\/code> \ub85c \ubc14\uafb8\uba74<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/13-4.png\" alt=\"\"><\/p>\n<p>\uc21c\ud68c\ud55c\ub2e4.<\/p>\n<h4>7-1-3-3-configurable<\/h4>\n<p><code> configurable: true<\/code> \ub85c \ubc14\uafd4\ubcf8\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">delete user.name;\nconsole.log(user);\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/14-4.png\" alt=\"\"><\/p>\n<p>name \uc774 \uc0ad\uc81c\ub428<br \/>\n<code> configurable: false<\/code> \ub85c \uc218\uc815<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aabbee.cafe24.com\/wp-content\/uploads\/2026\/06\/15-5.png\" alt=\"\"><\/p>\n<p>\uc0ad\uc81c \uc548\ub428<\/p>\n<h4>7-1-4-<code>defineProperties()<\/code><\/h4>\n<p>\uc5ec\ub7ec\uac1c\uc758 \ud504\ub85c\ud37c\ud2f0\ub97c \ud55c\ubc88\uc5d0 \uc815\uc758\ud560\ub54c\ub294<code> Object.defineProperties()<\/code> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-javascript\">    Object.defineProperties(user, {\n      name: {\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n      age: {\n        writable: false,\n        enumerable: true,\n        configurable: false\n      },\n      rule: {\n        writable: false,\n        enumerable: true,\n        configurable: false\n      }\n    })\n<\/code><\/pre>\n<p>\uac1d\uccb4\uc758 \ud504\ub85c\ud37c\ud2f0\uc5d0 \uc0ac\uc6a9\uc790 \uc811\uadfc \ubc29\uc9c0\uc2dc \uc0ac\uc6a9\ud560\uc218 \uc788\ub2e4.<\/p>\n<h3>7-2-\uc811\uadfc\uc790 \ud504\ub85c\ud37c\ud2f0<\/h3>\n<h3>7-2-1-get<\/h3>\n<pre><code class=\"language-javascript\">\n{\n  const person = {\n    name: &#39;kim&#39;,\n    age: 20,\n    get profile() { return `${this.name}-${this.age} ` },\n  }\n  console.log(person.profile);\n}\n<\/code><\/pre>\n<h3>7-2-2-set<\/h3>\n<pre><code class=\"language-javascript\">{\n  const person = {\n    name: &#39;kim&#39;,\n    age: 20,\n    get profile() { return `${this.name}-${this.age} ` },\n**    set profile(x) { [this.name, this.age] = x.split(&#39;-&#39;) }**\n  }\n  \/\/console.log(person.profile(&quot;\uc6a9-25&quot;));\n  console.log(person.profile = &quot;park-25&quot;);\n}\n<\/code><\/pre>\n<h2>8-\uba54\uc11c\ub4dc \uccb4\uc774\ub2dd<\/h2>\n<pre><code class=\"language-javascript\">const calculate = {\n  value: 0,\n  add: function (n1) {\n    this.value += n1;\n    return this;\n  },\n  subtract: function (n1) {\n    this.value -= n1;\n    return this;\n  },\n  result: function () {\n    return this.value\n  }\n}\n\nconst result = calculate.add(10).subtract(5).result();\nconsole.log(result);\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">const calculate2 = {\n  add: function (n1, n2) { return n1 + n2 },\n  subtract: function (n1, n2) { return n1 - n2 },\n  multiply: function (n1, n2) { return n1 * n2 },\n  devide: function (n1, n2) { return n1 \/ n2 },\n}\nlet n = 0;\nconst res1 = calculate2.add(n, 50)\nconst res2 = calculate2.subtract(res1, 50)\nconsole.log(res2);\n<\/code><\/pre>\n<hr>\n<h2>9-\ubb38\uc81c<\/h2>\n<p><strong><code>\ucd9c\ucc98:\uc218\ucf54\ub529(<\/code><\/strong><a href=\"https:\/\/www.sucoding.kr\/\"><strong><code>https:\/\/www.sucoding.kr<\/code><\/strong><\/a><strong><code>)<\/code><\/strong><\/p>\n<h3>9-1. \uac1d\uccb4 \ubcd1\ud569<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\ub450 \uac1c\uc758 \uac1d\uccb4\ub97c \ubcd1\ud569\ud558\uc5ec \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694.<br \/>\n\uc911\ubcf5\ub41c \ud0a4\uac00 \uc788\uc744 \uacbd\uc6b0, \ub450 \ubc88\uc9f8 \uac1d\uccb4\uc758 \uac12\uc774 \uc6b0\uc120\ud569\ub2c8\ub2e4.<br \/>\n<strong>\uc785\ub825:<\/strong><\/p>\n<pre><code class=\"language-javascript\">\nconst obj1 = { a: 1, b: 2 };\nconst obj2 = { b: 3, c: 4 };\nconsole.log(mergeObjects(obj1, obj2)); \/\/ { a: 1, b: 3, c: 4 }\n\nconst obj3 = { x: 10 };\nconst obj4 = { y: 20 };\nconsole.log(mergeObjects(obj3, obj4)); \/\/ { x: 10, y: 20 }\n\nconst obj5 = { a: 1, b: 2 };\nconst obj6 = { a: 3, b: 4 };\nconsole.log(mergeObjects(obj5, obj6)); \/\/ { a: 3, b: 4 }\n\nconst obj7 = {};\nconst obj8 = { z: 5 };\nconsole.log(mergeObjects(obj7, obj8)); \/\/ { z: 5 }\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction mergeObjects(obj1, obj2) {<br \/>\n  const merge = {};<\/p>\n<p>  for (let key in obj1) {<br \/>\n    merge[key] = obj1[key];<br \/>\n  }<\/p>\n<p>  for (let key in obj2) {<br \/>\n    merge[key] = obj2[key];<br \/>\n  }<\/p>\n<p>  return merge;<br \/>\n}<\/p>\n<p>const obj1 = { a: 1, b: 2 };<br \/>\nconst obj2 = { b: 3, c: 4 };<br \/>\nconsole.log(mergeObjects(obj1, obj2)); \/\/ { a: 1, b: 3, c: 4 }<\/p>\n<pre><code>\n\n```javascript\nfunction mergeObjects(obj1, obj2) {\n  return { ...obj1, ...obj2 };\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<h3>9-2. \ud0a4-\uac12 \ubc30\uc5f4\ud654<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc758 \ud0a4-\uac12 \uc30d\uc744 \ubc30\uc5f4\ub85c \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc2dc\uc624.<br \/>\n<strong>\uc785\ub825:<\/strong><\/p>\n<pre><code class=\"language-javascript\">\nconst obj = { a: 1, b: 2, c: 3 };\nconsole.log(objectToArray(obj)); \/\/ [[&#39;a&#39;, 1], [&#39;b&#39;, 2], [&#39;c&#39;, 3]]\n\nconst obj2 = { x: 5, y: 10 };\nconsole.log(objectToArray(obj2)); \/\/ [[&#39;x&#39;, 5], [&#39;y&#39;, 10]]\n\nconst obj3 = { p: 3 };\nconsole.log(objectToArray(obj3)); \/\/ [[&#39;p&#39;, 3]]\n\nconst obj4 = {};\nconsole.log(objectToArray(obj4)); \/\/ []\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction objectToArray(obj) {<br \/>\n  const result = [];<br \/>\n  for (let key in obj) {<br \/>\n    result.push([key, obj[key]]);<br \/>\n  }<br \/>\n  return result;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<pre><code class=\"language-javascript\">function objectToArray(obj) {\n  return Object.entries(obj);\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<h3>9-3. \uac1d\uccb4 \uac12 \ud544\ud130\ub9c1<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc5d0\uc11c \uac12\uc774 \ud2b9\uc815 \uae30\uc900 \uc774\uc0c1\uc778 \ud0a4-\uac12 \uc30d\ub9cc \ud544\ud130\ub9c1\ud558\uc5ec \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694<br \/>\n<strong>\uc785\ub825<\/strong><\/p>\n<pre><code class=\"language-javascript\">\nconst obj = { a: 1, b: 5, c: 3 };\nconst threshold = 2;\nconsole.log(filterByThreshold(obj, threshold)); \/\/ { b: 5, c: 3 }\n\nconst obj2 = { x: 1, y: 2, z: 3 };\nconst threshold2 = 2;\nconsole.log(filterByThreshold(obj2, threshold2)); \/\/ { y: 2, z: 3 }\n\nconst obj3 = { a: 10, b: 5, c: 1 };\nconst threshold3 = 6;\nconsole.log(filterByThreshold(obj3, threshold3)); \/\/ { a: 10 }\n\nconst obj4 = { m: -1, n: 0, o: 1 };\nconst threshold4 = 0;\nconsole.log(filterByThreshold(obj4, threshold4)); \/\/ { n: 0, o: 1 }\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction filterByThreshold(obj, threshold) {<br \/>\n  const result = {};<br \/>\n  for (let key in obj) {<br \/>\n    if (obj[key] >= threshold) result[key] = obj[key];<br \/>\n  }<br \/>\n  return result;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<pre><code class=\"language-javascript\">function filterByThreshold(obj, threshold) {\n  const result = {};\n  Object.entries(obj).forEach(([key, value]) =&gt; {\n    if (value &gt;= threshold) {\n      result[key] = value;\n    }\n  });\n  return result;\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<h3>9-4. \uac1d\uccb4\uc758 \uac12 \ubcc0\ud654<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc758 \ubaa8\ub4e0 \uac12\uc744 \uc81c\uacf1\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694<br \/>\n<strong>\uc785\ucd9c\ub825<\/strong><\/p>\n<pre><code class=\"language-javascript\">const obj = { a: 1, b: 2, c: 3 };\nconsole.log(squareValues(obj)); \/\/ { a: 1, b: 4, c: 9 }\n\nconst obj2 = { x: 2, y: 3 };\nconsole.log(squareValues(obj2)); \/\/ { x: 4, y: 9 }\n\nconst obj3 = { p: 0, q: -2 };\nconsole.log(squareValues(obj3)); \/\/ { p: 0, q: 4 }\n\nconst obj4 = {};\nconsole.log(squareValues(obj4)); \/\/ {}\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction squareValues(obj) {<br \/>\n  const result = {};<br \/>\n  \/\/ \ub85c\uc9c1<br \/>\n  for (let key in obj) {<br \/>\n    result[key] = obj[key] * obj[key];<br \/>\n  }<br \/>\n  return result;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<pre><code class=\"language-javascript\">function squareValues(obj) {\n  const result = {};\n  \/\/ \ub85c\uc9c1\n  Object.keys(obj).forEach((key) =&gt; {\n    result[key] = obj[key] ** 2;\n  });\n  return result;\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<h3>9-5. \uac1d\uccb4\uc5d0\uc11c \ud2b9\uc815 \ud0a4 \uc0ad\uc81c<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc5d0\uc11c \ud2b9\uc815 \ud0a4\ub97c \uc0ad\uc81c\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694<br \/>\n<strong>\uc785\ucd9c\ub825<\/strong><\/p>\n<pre><code class=\"language-javascript\">const obj = { a: 1, b: 2, c: 3 };\nconst keyToDelete = &#39;b&#39;;\nconsole.log(deleteKey(obj, keyToDelete)); \/\/ { a: 1, c: 3 }\n\nconst obj2 = { x: 10, y: 20, z: 30 };\nconst keyToDelete2 = &#39;y&#39;;\nconsole.log(deleteKey(obj2, keyToDelete2)); \/\/ { x: 10, z: 30 }\n\nconst obj3 = { a: 5 };\nconst keyToDelete3 = &#39;a&#39;;\nconsole.log(deleteKey(obj3, keyToDelete3)); \/\/ {}\n\nconst obj4 = { m: 1, n: 2, o: 3 };\nconst keyToDelete4 = &#39;p&#39;;\nconsole.log(deleteKey(obj4, keyToDelete4)); \/\/ { m: 1, n: 2, o: 3 }\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction deleteKey(obj, keyToDelete) {<br \/>\n  const result = {};<br \/>\n  for (let key in obj) {<br \/>\n    if (key !== keyToDelete) result[key] = obj[key];<br \/>\n  }<br \/>\n  return result;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<pre><code class=\"language-javascript\">function deleteKey(obj, keyToDelete) {\n  const result = { ...obj };\n  delete result[keyToDelete];\n  return result;\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<h3>9-6. \uac1d\uccb4\uc758 \uc911\ubcf5 \uac12 \uc81c\uac70<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc5d0\uc11c \uc911\ubcf5\ub41c \uac12\uc744 \uc81c\uac70\ud558\uace0, \uadf8\uc5d0 \ud574\ub2f9\ud558\ub294 \ud0a4\ub9cc \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694<br \/>\n\uc785\ucd9c\ub825<\/p>\n<pre><code class=\"language-javascript\">const obj = { a: 1, b: 2, c: 1, d: 3 };\nconsole.log(removeDuplicateValues(obj)); \/\/ { b: 2, d: 3 }\n\nconst obj2 = { x: 5, y: 5, z: 10 };\nconsole.log(removeDuplicateValues(obj2)); \/\/ { z: 10 }\n\nconst obj3 = { p: 1, q: 1, r: 1 };\nconsole.log(removeDuplicateValues(obj3)); \/\/ {}\n\nconst obj4 = { m: 3, n: 4, o: 3 };\nconsole.log(removeDuplicateValues(obj4)); \/\/ { n: 4 }\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<\/p>\n<p>function removeDuplicateValues(obj) {<br \/>\n  const count = {}; \/\/ \uac12\uc758 \uac2f\uc218\ub97c \uc138\ub294 \uac1d\uccb4<br \/>\n  const result = {}; \/\/ \ucd5c\uc885 \uacb0\uacfc \uac1d\uccb4<\/p>\n<p>  \/\/ \uac12\uc774 \uba87\ubc88 \ub4f1\uc7a5\ud588\ub294\uc9c0 \uacc4\uc0b0<br \/>\n  Object.values(obj).forEach((value) =&gt; {<br \/>\n    count[value] = (count[value] || 0) + 1;<br \/>\n  });<\/p>\n<p>  Object.keys(obj).forEach((key) =&gt; {<br \/>\n    if (count[obj[key]] === 1) {<br \/>\n      result[key] = obj[key];<br \/>\n    }<br \/>\n  });<\/p>\n<p>  return result;<br \/>\n}<\/p>\n<pre><code>&lt;\/Accordion&gt;\n\n\n### 9-7. \uac1d\uccb4\uc758 \uac12\uc73c\ub85c \ud0a4 \ucc3e\uae30\n\n#### \ubb38\uc81c\n\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc5d0\uc11c \ud2b9\uc815 \uac12\uc5d0 \ud574\ub2f9\ud558\ub294 \ud0a4\ub97c \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694. \uac12\uc774 \uc5ec\ub7ec \uac1c\uc77c \uacbd\uc6b0, \uccab \ubc88\uc9f8 \ud0a4\ub9cc \ubc18\ud658\ud55c\ub2e4. \uac12\uc774 \uc5c6\uc73c\uba74 null\uc744 \ubc18\ud658\ud558\uc138\uc694\n\uc785\ucd9c\ub825\n\n```javascript\nconst obj = { a: 1, b: 2, c: 3 };\nconsole.log(findKeyByValue(obj, 2)); \/\/ &#39;b&#39;\nconsole.log(findKeyByValue(obj, 4)); \/\/ null\nconsole.log(findKeyByValue(obj, 1)); \/\/ &#39;a&#39;\nconsole.log(findKeyByValue({}, 1)); \/\/ null\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction findKeyByValue(obj, value) {<br \/>\n  for (let key in obj) {<br \/>\n    if (obj[key] === value) return key;<br \/>\n  }<br \/>\n  return null;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<pre><code class=\"language-javascript\">function findKeyByValue(obj, value) {\n  const keys = Object.keys(obj);\n  for (let key of keys) {\n    if (obj[key] === value) return key;\n  }\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n<h3>9-8. \uac1d\uccb4\uc758 \ubaa8\ub4e0 \uac12 \uacf1\ud558\uae30<\/h3>\n<h4>\ubb38\uc81c<\/h4>\n<p>\uc8fc\uc5b4\uc9c4 \uac1d\uccb4\uc758 \ubaa8\ub4e0 \uac12\ub4e4\uc744 \uacf1\ud558\uc5ec \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \uc791\uc131\ud558\uc138\uc694.<br \/>\n\uc785\ucd9c\ub825<\/p>\n<pre><code class=\"language-javascript\">const obj = { a: 1, b: 2, c: 3 };\nconsole.log(multiplyValues(obj)); \/\/ 6\n\nconst obj2 = { x: 2, y: 3, z: 4 };\nconsole.log(multiplyValues(obj2)); \/\/ 24\n\nconst obj3 = { a: 1, b: 0, c: 3 };\nconsole.log(multiplyValues(obj3)); \/\/ 0\n\nconst obj4 = {};\nconsole.log(multiplyValues(obj4)); \/\/ 1 (\uacf1\uc148\uc758 \ud56d\ub4f1\uc6d0)\n<\/code><\/pre>\n<p><Accordion title=\"\ub2f5\"><br \/>\n&#8220;`javascript<br \/>\nfunction multiplyValues(obj) {<br \/>\n  let result = 1;<br \/>\n  for (let key in obj) {<br \/>\n    result *= obj[key];<br \/>\n  }<br \/>\n  return result;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<pre><code class=\"language-javascript\">function multiplyValues(obj) {\n  let result = 1;\n  Object.values(obj).forEach((value) =&gt; {\n    result *= value;\n  });\n  return result;\n}\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">function multiplyValues(obj) {\n  const values = Object.values(obj);\n  return values.reduce((acc, cur) =&gt; {\n    return acc * cur;\n  }, 1);\n}\n<\/code><\/pre>\n<p><\/Accordion><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1-\uac1c\ub150 1-1-\uc815\uc758 0\uac1c \uc774\uc0c1\uc758 \ud504\ub85c\ud37c\ud2f0(property:\uc18d\uc131) \uc758 \uc9d1\ud569. \ud654\uc0b4\ud45c\ud568\uc218\uc5d0\uc11c\ub294 \ud568\uc218\uc758 \ub809\uc2dc\uceec \uc2a4\ucf54\ud504\ub97c \uac00\ub974\ud0b4&quot; const person = { name: &#39;Kim&#39;, \/\/ \ud504\ub85c\ud37c\ud2f0 age: 30, \/\/ \ud504\ub85c\ud37c\ud2f0 ~~ greet: function () { \/\/ \uba54\uc11c\ub4dc return `Hello, I&#39;m ${this.name}`; } ~~greet() { \/\/ \uba54\uc11c\ub4dc return `Hello, I&#39;m ${this.name}`; } }; \ud504\ub85c\ud37c\ud2f0\ub294 \ud0a4(key)\uc640 \uac12(value)\uc73c\ub85c \uad6c\uc131\ub428. \ud504\ub85c\ud37c\ud2f0: \uac1d\uccb4\uc758 \uc0c1\ud0dc\ub97c \ub098\ud0c0\ub0b4\ub294 \uac12 &#8230; <a title=\"5-\uac1d\uccb4\" class=\"read-more\" href=\"https:\/\/coalacoding.com\/?p=414\" aria-label=\"5-\uac1d\uccb4\uc5d0 \ub300\ud574 \ub354 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uc138\uc694\">\ub354 \uc77d\uae30<\/a><\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-javascript-basics"],"_links":{"self":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=414"}],"version-history":[{"count":2,"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/414\/revisions"}],"predecessor-version":[{"id":2221,"href":"https:\/\/coalacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/414\/revisions\/2221"}],"wp:attachment":[{"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coalacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}