{"id":1108,"date":"2014-10-16T16:15:17","date_gmt":"2014-10-16T13:15:17","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=1108"},"modified":"2014-10-14T15:56:59","modified_gmt":"2014-10-14T12:56:59","slug":"javascript-closure-examples","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/","title":{"rendered":"JavaScript Closure &#8211; examples"},"content":{"rendered":"<p>Earlier, I talked about the <a href=\"http:\/\/veerasundar.com\/blog\/2013\/08\/javascript-closures\/\">basics of JavaScript Closure<\/a>. In this post, lets continue to explore Closure with the help of some practical examples.<\/p>\n<p>Before we begin, just to recap,<\/p>\n<blockquote>\n<p style=\"text-align: left;\">Closure encloses function and the set of variables that were in scope of the function when it was declared. The variables inside the closure kept alive as long as the function alive.<\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>With that in mind, let&#8217;s make some closures.<\/p>\n<h2>1. Maintain State between function calls<\/h2>\n<p>Let&#8217;s say you have function <code>add()<\/code> and you&#8217;d like it to add all the values passed to it in several calls and return the sum. For example,<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">add(5); \/\/ returns 5\r\nadd(20); \/\/ returns 25 (5+20)\r\nadd(3); \/\/ returns 28 (25 + 3)<\/pre>\n<p>Of course, you can use a global variable in order to hold the total. But keep in mind that <a href=\"http:\/\/en.wikipedia.org\/wiki\/Tyrannosaurus\">this dude<\/a> will eat you alive if you (ab)use globals.<\/p>\n<p>For scenarios like this, Closure is the best candidate for maintaining state between function calls without using globals. Let&#8217;s see how.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\/\/ Using IIFE, to not to pollute global namespace.\r\n(function(){\r\n\r\n  var addFn = function addFn(){\r\n    \/\/ local to closure and hold the value inbetween multiple calls.\r\n    var total = 0;\r\n    return function(val){\r\n      total += val;\r\n      return total;\r\n    }\r\n\r\n  };\r\n\r\n  var add = addFn();\r\n\r\n  console.log(add(5)); \/\/ 5\r\n  console.log(add(20)); \/\/ 25\r\n  console.log(add(3)); \/\/ 28\r\n\r\n}());<\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/gHZjA\/\">Run this example on JSFiddle<\/a>.<\/p>\n<h2>2. Partial application, a.k.a Currying<\/h2>\n<p>Suppose you have a function that takes several arguments and you only know values for some of the arguments in the beginning. For this scenario, you can make use of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Currying\">Currying<\/a> technique to pre-fill the values for known arguments and supply values for the rest of the arguments later.<\/p>\n<p>Here&#8217;s an example, illustrating Currying using Closure.<\/p>\n<p>Assume you have a <code>showMessage()<\/code> function that shows given message on screen with the given type and position. It takes three arguments. So, every time you want to call this function, you need to supply these three values.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">(function(){\r\n  function showMessage(type, position, message){\r\n    \/\/ displays a message at position and sets it type (for CSS styling)\r\n  }\r\n\r\n  showMessage('error', 'top', 'Not good.');\r\n  showMessage('info', 'top', 'You better know this.');\r\n\r\n}());<\/pre>\n<p>What if you want to make this function call, simpler? What if you create two other methods, namely, <code>showError()<\/code> and <code>showInfo()<\/code> that prefill the message type and position and supply the actual message in a later point in time? Let&#8217;s Curry them.<\/p>\n<p>The Curry function is taken from <a href=\"http:\/\/ejohn.org\/blog\/partial-functions-in-javascript\/\">John Resig&#8217;s post<\/a> (which btw is a good read <a href=\"http:\/\/ejohn.org\/blog\/partial-functions-in-javascript\/\">about Currying<\/a>).<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">(function(){\r\n\r\n  \/\/ Lets add Curry method to Function so that we can call it on any function we want.\r\n  Function.prototype.curry = function(){\r\n    var fn = this, args = Array.prototype.slice.call(arguments);\r\n    return function(){\r\n      return fn.apply(this, args.concat(Array.prototype.slice.call(arguments)));\r\n    };\r\n  };\r\n\r\n  \/\/ Core method.\r\n  function showMessage(type, position, message){\r\n    console.log('showing &#x5B;' + message + '] of type &#x5B;' + type + '] at &#x5B;' + position + '].' );\r\n  }\r\n\r\n  \/\/ Create special versions of Core method using Currying.\r\n  var showError = showMessage.curry('error', 'top');\r\n  var showInfo = showMessage.curry('info', 'bottom');\r\n\r\n  \/\/ Call our special methods.\r\n  showError('Not good.');\r\n  showInfo('You better know this.');\r\n\r\n}());<\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/3GqcW\/\">Run this example of JSFiddle<\/a><\/p>\n<h2>3. Private methods in JavaScript?<\/h2>\n<p>Yes, we can emulate private methods in JavaScript using Closure. Let&#8217;e see how.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">(function(){\r\n\r\n  var makeCar = function(){\r\n\r\n    \/\/ private variable\r\n    var fuel = 0;\r\n\r\n    \/\/ private method\r\n    function burnFuel(){\r\n      fuel-=10;\r\n      console.log('Burned fuel &#x5B;10]');\r\n    }\r\n\r\n    return {\r\n      accelerate : function(){\r\n        if(fuel &gt; 0){\r\n          burnFuel();\r\n        }else{\r\n          console.log('Out of gas. Fill now.');\r\n        }\r\n      },\r\n\r\n      fillGas : function(gas){\r\n        if(fuel &lt;= 100){\r\n          fuel += gas;\r\n        }else{\r\n          console.log('Reached capacity. Stop spilling.');\r\n        }\r\n      }\r\n    }\r\n\r\n  };\r\n\r\n  var car = makeCar();\r\n  car.accelerate(); \/\/ Out of gas. Fill now.\r\n  car.fillGas(75);\r\n  car.accelerate(); \/\/ Burned fuel &#x5B;10]\r\n  car.accelerate(); \/\/ Burned fuel &#x5B;10]\r\n\r\n}());<\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/Fka3b\/\">Run this example on JSFiddle<\/a><\/p>\n<p>As you can see, the <code>makeCar()<\/code> function returns an object with two methods: <code>accelerate<\/code> and <code>fillGas<\/code>. These two methods has access to the private method <code>burnFuel<\/code> and private variable <code>fuel<\/code>. But the outer world can not directlty access these two.<\/p>\n<p>So, with the help of closure you can simulate object oriented programming in JavaScript.<\/p>\n<p>With that, I am concluding this post of Closure examples. Of course, these are not the <em>only<\/em> examples of Closures. There are lot many out there. Btw, If you have written closure for an interesting use case, feel free to share it in the comments section.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/veerasundar.com\/blog\/2013\/08\/javascript-closure-examples\/\">JavaScript Closure &#8211; examples<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Veera Sundar at the <a href=\"http:\/\/veerasundar.com\/blog\/\">Veera Sundar<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before we begin, just to recap, Closure encloses function and the set of variables that were in scope of the function when it was declared. The variables inside the closure kept &hellip;<\/p>\n","protected":false},"author":6,"featured_media":920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-1108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JavaScript Closure - examples - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Closure - examples - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-16T13:15:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Veera Sundar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Veera Sundar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\"},\"author\":{\"name\":\"Veera Sundar\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/0246febd1de76c75168a687d7abb14b9\"},\"headline\":\"JavaScript Closure &#8211; examples\",\"datePublished\":\"2014-10-16T13:15:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\"},\"wordCount\":713,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\",\"name\":\"JavaScript Closure - examples - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"datePublished\":\"2014-10-16T13:15:17+00:00\",\"description\":\"Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Closure &#8211; examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/0246febd1de76c75168a687d7abb14b9\",\"name\":\"Veera Sundar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/02fcdbdd31df95e9a89687c658f225572027173dac294346eba87cbef25bb5cf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/02fcdbdd31df95e9a89687c658f225572027173dac294346eba87cbef25bb5cf?s=96&d=mm&r=g\",\"caption\":\"Veera Sundar\"},\"sameAs\":[\"http:\/\/veerasundar.com\/blog\/\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/veera-sundar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Closure - examples - Web Code Geeks - 2026","description":"Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before","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:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Closure - examples - Web Code Geeks - 2026","og_description":"Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2014-10-16T13:15:17+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","type":"image\/jpeg"}],"author":"Veera Sundar","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Veera Sundar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/"},"author":{"name":"Veera Sundar","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/0246febd1de76c75168a687d7abb14b9"},"headline":"JavaScript Closure &#8211; examples","datePublished":"2014-10-16T13:15:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/"},"wordCount":713,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/","name":"JavaScript Closure - examples - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","datePublished":"2014-10-16T13:15:17+00:00","description":"Earlier, I talked about the basics of JavaScript Closure. In this post, lets continue to explore Closure with the help of some practical examples. Before","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-closure-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript Closure &#8211; examples"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/0246febd1de76c75168a687d7abb14b9","name":"Veera Sundar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/02fcdbdd31df95e9a89687c658f225572027173dac294346eba87cbef25bb5cf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/02fcdbdd31df95e9a89687c658f225572027173dac294346eba87cbef25bb5cf?s=96&d=mm&r=g","caption":"Veera Sundar"},"sameAs":["http:\/\/veerasundar.com\/blog\/"],"url":"https:\/\/www.webcodegeeks.com\/author\/veera-sundar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/1108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=1108"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/1108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=1108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=1108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=1108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}