{"id":2439,"date":"2024-09-12T17:14:25","date_gmt":"2024-09-12T16:14:25","guid":{"rendered":"https:\/\/codeflarelimited.com\/blog\/?p=2439"},"modified":"2024-09-16T17:52:04","modified_gmt":"2024-09-16T16:52:04","slug":"this-keyword-in-javascript","status":"publish","type":"post","link":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/","title":{"rendered":"Deep Dive into JavaScript\u2019s THIS Keyword"},"content":{"rendered":"\n<p>The <code>this<\/code> keyword in JavaScript is one of the most powerful yet often confusing aspects of the language. It can behave differently depending on how and where it is used, making it essential for developers to understand its nuances. In this article, we\u2019ll take a deep dive into the <code>this<\/code> keyword, how it works, and the various contexts in which it operates.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What is the <code>this<\/code> Keyword?<\/h4>\n\n\n\n<p>In JavaScript, <code>this<\/code> keyword refers to the object that is executing the current function. However, depending on the context in which the function is called, the value of <code>this<\/code> can change.<\/p>\n\n\n\n<p>The value of <code>this<\/code> is determined at runtime and can vary based on the following factors:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Where and how a function is invoked.<\/li>\n\n\n\n<li>Whether strict mode is enabled.<\/li>\n\n\n\n<li>The type of function (e.g., regular functions vs. arrow functions).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Global Context<\/h3>\n\n\n\n<p>In the global execution context, <code>this<\/code> points to the global object, which is <code>window<\/code> in a browser.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">console.log(this); \/\/ Window object in browsers\n<\/code><\/pre>\n\n\n\n<p>In this example, outside of any function, <code>this<\/code> points to the global object, which is <code>window<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Function Context<\/h3>\n\n\n\n<p>In a function, <code>this<\/code> behaves differently depending on how the function is invoked.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Regular Function Calls<\/h4>\n\n\n\n<p>When a function is called as a simple function, <code>this<\/code> refers to the global object in non-strict mode, and <code>undefined<\/code> in strict mode.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">function show() {\n    console.log(this);\n}\nshow(); \/\/ In non-strict mode: Window, in strict mode: undefined\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. Object Methods<\/h4>\n\n\n\n<p>When a function is called as a method of an object, <code>this<\/code> refers to the object to which the method belongs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const person = {\n    name: \"John\",\n    greet: function() {\n        console.log(this.name);\n    }\n};\nperson.greet(); \/\/ \"John\"\n<\/code><\/pre>\n\n\n\n<p>In this case, <code>this<\/code> inside <code>greet()<\/code> refers to the <code>person<\/code> object because the function is a method of that object.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Arrow Functions<\/strong><\/h3>\n\n\n\n<p>One of the most critical differences in behavior comes when using arrow functions. Unlike regular functions, arrow functions do not have their own <code>this<\/code>. Instead, they inherit <code>this<\/code> from the surrounding lexical context.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const person = {\n    name: \"Alice\",\n    greet: () =&gt; {\n        console.log(this.name);\n    }\n};\nperson.greet(); \/\/ undefined\n<\/code><\/pre>\n\n\n\n<p>Here, the arrow function does not bind <code>this<\/code> to the <code>person<\/code> object, resulting in <code>undefined<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Lexical Binding with Arrow Functions<\/strong><\/h4>\n\n\n\n<p>Arrow functions are particularly useful when you want to maintain the value of <code>this<\/code> from the enclosing context.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">function Person() {\n    this.name = \"John\";\n    setTimeout(() =&gt; {\n        console.log(this.name); \/\/ Refers to the Person instance\n    }, 1000);\n}\nconst p = new Person(); \/\/ Outputs \"John\" after 1 second\n<\/code><\/pre>\n\n\n\n<p>In this example, <code>this<\/code> inside the arrow function refers to the <code>Person<\/code> instance because arrow functions lexically bind <code>this<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Constructor Functions<\/strong><\/h3>\n\n\n\n<p>In JavaScript, constructor functions are used to create objects. When a function is used as a constructor (called with <code>new<\/code>), <code>this<\/code> refers to the newly created object.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">function Car(make, model) {\n    this.make = make;\n    this.model = model;\n}\nconst car1 = new Car(\"Toyota\", \"Camry\");\nconsole.log(car1.make); \/\/ \"Toyota\"\n<\/code><\/pre>\n\n\n\n<p>In this case, <code>this<\/code> refers to the new <code>Car<\/code> object being created.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explicit Binding<\/strong><\/h3>\n\n\n\n<p>JavaScript allows you to explicitly bind <code>this<\/code> using methods like <code>call()<\/code>, <code>apply()<\/code>, and <code>bind()<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><code>call()<\/code> and <code>apply()<\/code><\/h4>\n\n\n\n<p>Both <code>call()<\/code> and <code>apply()<\/code> allow you to invoke a function with a specific <code>this<\/code> value. The difference between them lies in how they handle arguments: <code>call()<\/code> takes arguments individually, while <code>apply()<\/code> takes them as an array.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">function greet() {\n    console.log(this.name);\n}\nconst person = { name: \"Emily\" };\n\ngreet.call(person);  \/\/ \"Emily\"\ngreet.apply(person); \/\/ \"Emily\"\n<\/code><\/pre>\n\n\n\n<p>Here, both <code>call()<\/code> and <code>apply()<\/code> explicitly set <code>this<\/code> to the <code>person<\/code> object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><code>bind()<\/code><\/h4>\n\n\n\n<p>The <code>bind()<\/code> method returns a new function with a permanently bound <code>this<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const greetPerson = greet.bind(person);\ngreetPerson(); \/\/ \"Emily\"\n<\/code><\/pre>\n\n\n\n<p>In this example, <code>bind()<\/code> creates a new function where <code>this<\/code> is permanently set to <code>person<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Context vs. Scope<\/strong><\/h3>\n\n\n\n<p>One common source of confusion is mixing up <code>this<\/code> with scope. Scope refers to the accessibility of variables, whereas <code>this<\/code> refers to the object that is currently executing the code. They are separate concepts, and understanding both is key to mastering JavaScript.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Strict Mode and <code>this<\/code><\/strong><\/h3>\n\n\n\n<p>When using strict mode (<code>\"use strict\";<\/code>), the value of <code>this<\/code> in a function is <code>undefined<\/code> instead of the global object if not explicitly set.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">\"use strict\";\nfunction show() {\n    console.log(this);\n}\nshow(); \/\/ undefined\n<\/code><\/pre>\n\n\n\n<p>This helps avoid common pitfalls and unintended behavior in code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>The <code>this<\/code> keyword is central to many JavaScript functions and constructs. It can take on different values depending on the context in which it is used, making it crucial for developers to understand how it works in various situations. From object methods to arrow functions and explicit bindings with <code>call()<\/code>, <code>apply()<\/code>, and <code>bind()<\/code>, mastering <code>this<\/code> is a fundamental skill for writing clean, bug-free JavaScript code.<\/p>\n\n\n\n<p><a href=\"https:\/\/codeflarelimited.com\/blog\/react-lazy-for-code-splitting\/\">Implementing Code Splitting in React with React.Lazy<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The this keyword in JavaScript is one of the most powerful yet often confusing aspects of the language.<\/p>\n","protected":false},"author":3,"featured_media":2458,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[99],"class_list":["post-2439","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-software-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>This keyword in JavaScript<\/title>\n<meta name=\"description\" content=\"Learn how this keyword in JavaScript works in different contexts and enhance your understanding of its role in object-oriented programming\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"This keyword in JavaScript\" \/>\n<meta property=\"og:description\" content=\"Learn how this keyword in JavaScript works in different contexts and enhance your understanding of its role in object-oriented programming\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-12T16:14:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-16T16:52:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1120\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kene Samuel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/\"},\"author\":{\"name\":\"Kene Samuel\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/c501609bab46c16807eb32106074f206\"},\"headline\":\"Deep Dive into JavaScript\u2019s THIS Keyword\",\"datePublished\":\"2024-09-12T16:14:25+00:00\",\"dateModified\":\"2024-09-16T16:52:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/\"},\"wordCount\":586,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/IMG-20240916-WA0005.jpg\",\"keywords\":[\"software development\"],\"articleSection\":[\"javascript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/\",\"name\":\"This keyword in JavaScript\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/IMG-20240916-WA0005.jpg\",\"datePublished\":\"2024-09-12T16:14:25+00:00\",\"dateModified\":\"2024-09-16T16:52:04+00:00\",\"description\":\"Learn how this keyword in JavaScript works in different contexts and enhance your understanding of its role in object-oriented programming\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/IMG-20240916-WA0005.jpg\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/IMG-20240916-WA0005.jpg\",\"width\":1120,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/this-keyword-in-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"javascript\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/javascript\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Deep Dive into JavaScript\u2019s THIS Keyword\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"name\":\"\",\"description\":\"Sustainable solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\",\"name\":\"Codeflare Limited\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"width\":1040,\"height\":263,\"caption\":\"Codeflare Limited\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/c501609bab46c16807eb32106074f206\",\"name\":\"Kene Samuel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e1716cd715a5b5491e1f2da373b52f2f73aeb37d268baff34719116e386d848?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e1716cd715a5b5491e1f2da373b52f2f73aeb37d268baff34719116e386d848?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3e1716cd715a5b5491e1f2da373b52f2f73aeb37d268baff34719116e386d848?s=96&d=mm&r=g\",\"caption\":\"Kene Samuel\"},\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/author\\\/kene\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"This keyword in JavaScript","description":"Learn how this keyword in JavaScript works in different contexts and enhance your understanding of its role in object-oriented programming","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:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"This keyword in JavaScript","og_description":"Learn how this keyword in JavaScript works in different contexts and enhance your understanding of its role in object-oriented programming","og_url":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/","article_published_time":"2024-09-12T16:14:25+00:00","article_modified_time":"2024-09-16T16:52:04+00:00","og_image":[{"width":1120,"height":630,"url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg","type":"image\/jpeg"}],"author":"Kene Samuel","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#article","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/"},"author":{"name":"Kene Samuel","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/c501609bab46c16807eb32106074f206"},"headline":"Deep Dive into JavaScript\u2019s THIS Keyword","datePublished":"2024-09-12T16:14:25+00:00","dateModified":"2024-09-16T16:52:04+00:00","mainEntityOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/"},"wordCount":586,"commentCount":0,"publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg","keywords":["software development"],"articleSection":["javascript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/","url":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/","name":"This keyword in JavaScript","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#primaryimage"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg","datePublished":"2024-09-12T16:14:25+00:00","dateModified":"2024-09-16T16:52:04+00:00","description":"Learn how this keyword in JavaScript works in different contexts and enhance your understanding of its role in object-oriented programming","breadcrumb":{"@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#primaryimage","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg","width":1120,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/codeflarelimited.com\/blog\/this-keyword-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codeflarelimited.com\/blog\/"},{"@type":"ListItem","position":2,"name":"javascript","item":"https:\/\/codeflarelimited.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"Deep Dive into JavaScript\u2019s THIS Keyword"}]},{"@type":"WebSite","@id":"https:\/\/codeflarelimited.com\/blog\/#website","url":"https:\/\/codeflarelimited.com\/blog\/","name":"","description":"Sustainable solutions","publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codeflarelimited.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codeflarelimited.com\/blog\/#organization","name":"Codeflare Limited","url":"https:\/\/codeflarelimited.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","width":1040,"height":263,"caption":"Codeflare Limited"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/c501609bab46c16807eb32106074f206","name":"Kene Samuel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3e1716cd715a5b5491e1f2da373b52f2f73aeb37d268baff34719116e386d848?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3e1716cd715a5b5491e1f2da373b52f2f73aeb37d268baff34719116e386d848?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e1716cd715a5b5491e1f2da373b52f2f73aeb37d268baff34719116e386d848?s=96&d=mm&r=g","caption":"Kene Samuel"},"url":"https:\/\/codeflarelimited.com\/blog\/author\/kene\/"}]}},"jetpack_featured_media_url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2024\/09\/IMG-20240916-WA0005.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/2439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/comments?post=2439"}],"version-history":[{"count":5,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/2439\/revisions"}],"predecessor-version":[{"id":2445,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/2439\/revisions\/2445"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media\/2458"}],"wp:attachment":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media?parent=2439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/categories?post=2439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/tags?post=2439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}