{"id":224766,"date":"2020-01-22T15:37:18","date_gmt":"2020-01-22T15:37:18","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=224766"},"modified":"2020-01-23T12:57:19","modified_gmt":"2020-01-23T12:57:19","slug":"javascript-object-methods","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/javascript-object-methods\/","title":{"rendered":"Javascript Object methods"},"content":{"rendered":"\n<p>Hey, do you know javascript has some Object methods and you can manipulate your object by using that. We will look into such methods in this blog.<\/p>\n\n\n\n<p>Before starting, let&#8217;s observe master obj (Object) closely<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nconsole.dir(Object);\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>Please see below result<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1010\" height=\"463\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png\" alt=\"master_object_result\" class=\"wp-image-225043\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png 1010w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result-300x138.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result-250x115.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result-768x352.png 768w\" sizes=\"(max-width: 1010px) 100vw, 1010px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>As you can see above, some methods are listed like assign, create, freeze, etc so we will look into some of the methods in this blog.<\/p>\n\n\n\n<p><strong>Object.create()<\/strong><\/p>\n\n\n\n<p>This method is used to create new object by using an existing object<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> Object.create(propertiesObject);<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {\n  profile: {\n    name: &#039;john doe&#039;,\n    age: &#039;28&#039;\n  }\n};\nlet new_obj = Object.create(obj);\nconsole.log(new_obj.profile.name);  \/\/john doe\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>let&#8217;s see another example of create()<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet fun = function() {\n  this.firstName = &#039;john&#039;;\n  this.lastName = &#039;doe&#039;;\n};\nfun.prototype.fullName = function() {\n  return `firstname is ${this.firstName} and lastname is ${this.lastName}`;\n}\nlet obj = new fun();\nconsole.log(obj.fullName());  \/\/here result will be &#039;firstname is john and lastname is doe&#039;\n\nlet fun_new = function() {\n  fun.call(this);\n};\n\nfun_new.prototype = Object.create(fun.prototype);\n\nlet obj_new = new fun_new();\nconsole.dir(obj_new.fullName());  \/\/here also result will be &#039;firstname is john and lastname is doe&#039;\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>you can check call() method <a href=\"https:\/\/webkul.com\/blog\/javascript-call-and-apply\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><\/p>\n\n\n\n<p><strong>Object.assign()<\/strong><\/p>\n\n\n\n<p>it is used to copy one or more source objects into target object.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> Object.assign(targetObject, ..sourceObjects);<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet source = {\n  profile: {\n    name: &#039;john doe&#039;,\n    age: &#039;28&#039;\n  }\n};\nlet target = {\n  address: {\n    city: &#039;noida&#039;,\n    country: &#039;india&#039;\n  }\n};\nlet assign_obj = Object.assign(target, source);\nconsole.log(`${assign_obj.profile.name} from ${assign_obj.address.city} ${assign_obj.address.country}`);  \/\/john doe from noida india\nconsole.log(`${target.profile.name} from ${target.address.city} ${target.address.country}`);  \/\/john doe from noida india\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>what happens if target and source objects have the same properties<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet target = {\n  x: &#039;20&#039;,\n  y: &#039;50&#039;\n};\nlet source1 = {\n  x: &#039;30&#039;,\n  z: &#039;60&#039;\n};\nlet source2 = {\n  x: &#039;40&#039;,\n};\nObject.assign(target, source1, source2);\nconsole.log(target);  \/\/{x: &quot;40&quot;, y: &quot;50&quot;, z: &quot;60&quot;}\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>Object.defineProperty()<\/strong><\/p>\n\n\n\n<p>You can define an object property by Object.defineProperty()<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> Object.defineProperty(obj, property, descriptor);<\/p>\n\n\n\n<p>Let&#8217;s see an example<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {};\n\nObject.defineProperty(obj, &#039;firstName&#039;, {value: &#039;john&#039;, writable: true});\nObject.defineProperty(obj, &#039;lastName&#039;, {value: &#039;doe&#039;, writable: true, enumerable: true, configurable: false});\nObject.defineProperty(obj, &#039;fullName&#039;, {\n  get: function(){\n    return `firstname is ${this.firstName} and lastname is ${this.lastName}`;\n  },\n  set: function(name){\n    [this.firstName, this.lastName] = name.split(&quot; &quot;);\n  }\n});\nconsole.log(obj.fullName);  \/\/ here result will be &quot;firstname is john and lastname is doe&quot;\n\nobj.fullName = &#039;webkul software&#039;;\n\nconsole.log(obj.fullName);  \/\/ here result will be &quot;firstname is webkul and lastname is software&quot;\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>value:<\/strong> what will be the value of your property<\/p>\n\n\n\n<p><strong>writable:<\/strong> default it is false which can not be changed, if set true then you can change property<\/p>\n\n\n\n<p><strong>enumerable: <\/strong>if true then it will display during enumeration<\/p>\n\n\n\n<p><strong>configurable:<\/strong> default it is false, if true then you can not delete this property<\/p>\n\n\n\n<p><strong>Set\/Get: <\/strong>if using getter and setter then you can not use other keys like writable, enumerable, etc<\/p>\n\n\n\n<p>You can check getter\/setter <a href=\"https:\/\/webkul.com\/blog\/getter-setter-in-javascript\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a><\/p>\n\n\n\n<p><strong>Object.defineProperties()<\/strong><\/p>\n\n\n\n<p>if you want to add multiple properties then you can use it<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> Object.defineProperties(obj, properties);<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {};\n\nObject.defineProperties(obj, {\n  firstName: {\n    value: &#039;john&#039;,\n    writable: true\n  },\n  lastName: {\n    value: &#039;doe&#039;, writable: true, enumerable: true, configurable: false\n  },\n  fullName: {\n    get: function(){\n      return `firstname is ${this.firstName} and lastname is ${this.lastName}`;\n    },\n    set: function(name){\n      [this.firstName, this.lastName] = name.split(&quot; &quot;);\n    }\n  }\n});\nconsole.log(obj.fullName);  \/\/ here result will be &quot;firstname is john and lastname is doe&quot;\n\nobj.fullName = &#039;webkul software&#039;;\n\nconsole.log(obj.fullName);  \/\/ here result will be &quot;firstname is webkul and lastname is software&quot;\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>as you can see in the upper example, I have added three properties similar to Object.defineProperty() example<\/p>\n\n\n\n<p><strong>Object.keys()<\/strong><\/p>\n\n\n\n<p>It is used for enumerable keys of an object. You will understand the &#8216;enumerable&#8217; key here which was used under Object.defineProperty ();<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> Object.keys(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {};\n\nObject.defineProperties(obj, {\n  firstName: {\n    value: &#039;john&#039;,\n    writable: true,\n    enumerable: true,\n  },\n  lastName: {\n    value: &#039;doe&#039;, writable: true, enumerable: true, configurable: false\n  },\n  fullName: {\n    get: function(){\n      return `firstname is ${this.firstName} and lastname is ${this.lastName}`;\n    },\n    set: function(name){\n      [this.firstName, this.lastName] = name.split(&quot; &quot;);\n    }\n  }\n});\n\nObject.keys(obj).map(function(current, index){\n  console.log(`property ${current} and position ${index}`);\n})\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>let&#8217;s see now by removing enumerable key for firstName property and see the following code<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {};\n\nObject.defineProperties(obj, {\n  firstName: {\n    value: &#039;john&#039;,\n    writable: true,\n  },\n  lastName: {\n    value: &#039;doe&#039;, writable: true, enumerable: true, configurable: false\n  },\n  fullName: {\n    get: function(){\n      return `firstname is ${this.firstName} and lastname is ${this.lastName}`;\n    },\n    set: function(name){\n      [this.firstName, this.lastName] = name.split(&quot; &quot;);\n    }\n  }\n});\n\nObject.keys(obj).map(function(current, index){\n  console.log(`property ${current} and position ${index}`);\n})\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>In the upper example, firstName property will not get resulted because enumerable is false for firstName property<\/p>\n\n\n\n<p><strong>Object.values()<\/strong><\/p>\n\n\n\n<p>It is used for getting all enumerable property values of my object not keys<\/p>\n\n\n\n<p><strong>Syntax:<\/strong> Object.values(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {};\n\nObject.defineProperties(obj, {\n  firstName: {\n    value: &#039;john&#039;,\n    writable: true,\n    enumerable: true\n  },\n  lastName: {\n    value: &#039;doe&#039;, writable: true, enumerable: true, configurable: false\n  },\n  fullName: {\n    get: function(){\n      return `firstname is ${this.firstName} and lastname is ${this.lastName}`;\n    },\n    set: function(name){\n      [this.firstName, this.lastName] = name.split(&quot; &quot;);\n    }\n  }\n});\n\nObject.values(obj).map(function(current, index){\n  console.log(`property ${current} and position ${index}`);\n})\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>Object.freeze()<\/strong><\/p>\n\n\n\n<p>Freeze method allows us to prevent add\/edit\/delete new or existing property. If trying to add\/edit\/delete in strict mode then it will generate errors.<\/p>\n\n\n\n<p><strong>syntax:<\/strong> Object.freeze(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {\n  firstName: &#039;john&#039;\n};\nObject.freeze(obj);\nobj.firstName = &#039;webkul&#039;;\nconsole.log(obj.firstName);\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>if you will run upper code, then you will get result &#8216;john&#8217; not &#8216;webkul&#8217; due to frozen<\/p>\n\n\n\n<p><strong>Object.isFrozen()<\/strong><\/p>\n\n\n\n<p>For checking any object is frozen or not<\/p>\n\n\n\n<p><strong>Syntax: <\/strong>Object.isFrozen(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {\n  firstName: &#039;john&#039;\n};\nObject.freeze(obj);\nconsole.log(Object.isFrozen(obj));\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>Object.seal()<\/strong><\/p>\n\n\n\n<p>seal method allows us to prevent add\/edit\/delete the new or existing property but any existing property can be changed if it is writable. If trying to add\/edit\/delete any new or existing property in strict mode then it will generate errors except edit in writable case.<\/p>\n\n\n\n<p><strong>syntax:<\/strong> Object.seal(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\n&#039;use strict&#039;;\nlet obj = {};\nObject.defineProperty(obj, &#039;firstName&#039;, {\n  value: &#039;john&#039;,\n  writable: true\n});\nObject.seal(obj);\nconsole.log(obj.firstName);  \/\/ here result is &#039;john&#039;\nobj.firstName = &#039;webkul&#039;;\nconsole.log(obj.firstName);  \/\/ here result is &#039;webkul&#039;\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>Object.isSealed()<\/strong><\/p>\n\n\n\n<p>For checking any object is sealed or not<\/p>\n\n\n\n<p><strong>syntax: <\/strong>Object.isSealed(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\n&#039;use strict&#039;;\nlet obj = {};\nObject.defineProperty(obj, &#039;firstName&#039;, {\n  value: &#039;john&#039;,\n  writable: true\n});\nObject.seal(obj);\nconsole.log(Object.isSealed(obj));\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>Object.preventExtensions()<\/strong><\/p>\n\n\n\n<p>this method has following features<\/p>\n\n\n\n<p>prevents to add new or existing property<\/p>\n\n\n\n<p>edit existing property only if  writable<\/p>\n\n\n\n<p>delete existing property if configurable<\/p>\n\n\n\n<p><strong>syntax:<\/strong> Object.preventExtensions(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\n&#039;use strict&#039;;\nlet obj = {\n  firstName: &#039;john&#039;\n};\nObject.defineProperty(obj, &#039;lastName&#039;, {\n  value: &#039;doe&#039;,\n  writable: true\n});\nObject.preventExtensions(obj);\nobj.lastName = &#039;software&#039;;  \/\/ can change due to writable\ndelete obj.firstName;  \/\/can delete due to default behavious configurable \nconsole.log(obj);\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>In the upper example, if you will try to delete &#8216;lastName&#8217; then you will get an error<\/p>\n\n\n\n<p><strong>Object.isExtensible()<\/strong><\/p>\n\n\n\n<p>For checking any object is extensible or not<\/p>\n\n\n\n<p><strong>syntax: <\/strong>Object.isExtensible(obj)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\n&#039;use strict&#039;;\nlet obj = {\n  firstName: &#039;john&#039;\n};\nObject.defineProperty(obj, &#039;lastName&#039;, {\n  value: &#039;doe&#039;,\n  writable: true\n});\nObject.preventExtensions(obj);\nconsole.log(Object.isExtensible(obj));  \/\/false\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><strong>Object.hasOwnProperty()<\/strong><\/p>\n\n\n\n<p>For checking any object&#8217;s property<\/p>\n\n\n\n<p><amp-fit-text layout=\"fixed-height\" min-font-size=\"6\" max-font-size=\"72\" height=\"80\"><strong>syntax: <\/strong>obj.hasOwnProperty(propertyName)<\/amp-fit-text><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;script&gt;\nlet obj = {\n  firstName: &#039;john&#039;\n};\nconsole.log(Object.hasOwnProperty(&#039;keys&#039;));     \/\/true\nconsole.log(obj.hasOwnProperty(&#039;firstName&#039;));  \/\/true\nconsole.log(obj.hasOwnProperty(&#039;lastName&#039;));  \/\/false\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>That&#8217;s it in this blog. I hope this blog was useful to you. Please ask if you have any queries in the comment section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, do you know javascript has some Object methods and you can manipulate your object by using that. We will look into such methods in this blog. Before starting, let&#8217;s observe master obj (Object) closely Please see below result As you can see above, some methods are listed like assign, create, freeze, etc so we <a href=\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":224,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-224766","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Javascript Object methods - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Javascript Object methods - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Hey, do you know javascript has some Object methods and you can manipulate your object by using that. We will look into such methods in this blog. Before starting, let&#8217;s observe master obj (Object) closely Please see below result As you can see above, some methods are listed like assign, create, freeze, etc so we [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-22T15:37:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-23T12:57:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png\" \/>\n<meta name=\"author\" content=\"Prabhat Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prabhat Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\"},\"author\":{\"name\":\"Prabhat Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/50845eb980b8da8dea2def8904ec5566\"},\"headline\":\"Javascript Object methods\",\"datePublished\":\"2020-01-22T15:37:18+00:00\",\"dateModified\":\"2020-01-23T12:57:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\"},\"wordCount\":570,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\",\"url\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\",\"name\":\"Javascript Object methods - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png\",\"datePublished\":\"2020-01-22T15:37:18+00:00\",\"dateModified\":\"2020-01-23T12:57:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/javascript-object-methods\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png\",\"width\":1010,\"height\":463,\"caption\":\"master_object_result\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/javascript-object-methods\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Javascript Object methods\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/50845eb980b8da8dea2def8904ec5566\",\"name\":\"Prabhat Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dbb1bb221277f0b032626ee13cc25b7fc46c2271db1bdf289ecd45f9dc7bfc06?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dbb1bb221277f0b032626ee13cc25b7fc46c2271db1bdf289ecd45f9dc7bfc06?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Prabhat Kumar\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/prabhatkumar-oc082\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Javascript Object methods - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/javascript-object-methods\/","og_locale":"en_US","og_type":"article","og_title":"Javascript Object methods - Webkul Blog","og_description":"Hey, do you know javascript has some Object methods and you can manipulate your object by using that. We will look into such methods in this blog. Before starting, let&#8217;s observe master obj (Object) closely Please see below result As you can see above, some methods are listed like assign, create, freeze, etc so we [...]","og_url":"https:\/\/webkul.com\/blog\/javascript-object-methods\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2020-01-22T15:37:18+00:00","article_modified_time":"2020-01-23T12:57:19+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png","type":"","width":"","height":""}],"author":"Prabhat Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Prabhat Kumar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/"},"author":{"name":"Prabhat Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/50845eb980b8da8dea2def8904ec5566"},"headline":"Javascript Object methods","datePublished":"2020-01-22T15:37:18+00:00","dateModified":"2020-01-23T12:57:19+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/"},"wordCount":570,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/javascript-object-methods\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/","url":"https:\/\/webkul.com\/blog\/javascript-object-methods\/","name":"Javascript Object methods - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png","datePublished":"2020-01-22T15:37:18+00:00","dateModified":"2020-01-23T12:57:19+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/javascript-object-methods\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2020\/01\/master_object_result.png","width":1010,"height":463,"caption":"master_object_result"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/javascript-object-methods\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Javascript Object methods"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/50845eb980b8da8dea2def8904ec5566","name":"Prabhat Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dbb1bb221277f0b032626ee13cc25b7fc46c2271db1bdf289ecd45f9dc7bfc06?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dbb1bb221277f0b032626ee13cc25b7fc46c2271db1bdf289ecd45f9dc7bfc06?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Prabhat Kumar"},"url":"https:\/\/webkul.com\/blog\/author\/prabhatkumar-oc082\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/224766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/224"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=224766"}],"version-history":[{"count":16,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/224766\/revisions"}],"predecessor-version":[{"id":225242,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/224766\/revisions\/225242"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=224766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=224766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=224766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}