{"id":372811,"date":"2023-03-29T14:03:10","date_gmt":"2023-03-29T14:03:10","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=372811"},"modified":"2024-06-06T06:26:24","modified_gmt":"2024-06-06T06:26:24","slug":"promises-in-javascript","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/promises-in-javascript\/","title":{"rendered":"Promises in JavaScript"},"content":{"rendered":"\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h3 class=\"wp-block-heading index-title\">Introduction:<\/h3>\n<\/div><\/div>\n\n\n\n<p>JavaScript is single-threaded, which means two bits of the script cannot run at the same time. They run one after another. A <strong>Promise<\/strong> is an object that allows you to associate handlers with an asynchronous action&#8217;s eventual success value or failure reason. <\/p>\n\n\n\n<p>Before proceeding, we should know about what is the difference between synchronous and asynchronous action. Synchronous means only one line of code will be executed at the same time but in the case of Asynchronous action, multiple lines of code will be executed simultaneously rather than one after another.<\/p>\n\n\n\n<p>Promises in JavaScript exist in one of the following 3 states:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pending:<\/strong> This is the initial state, which means that the operation was neither fulfilled nor rejected.<\/li>\n\n\n\n<li><strong>Fulfilled: <\/strong>It means the operation was completed successfully.<\/li>\n\n\n\n<li><strong>Rejected:<\/strong> It means the operation failed.<\/li>\n<\/ul>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h3 class=\"wp-block-heading index-title\">Syntax:<\/h3>\n<\/div><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\">let promise = new Promise(function (resolve, reject) {\n    \/\/ executor\n});<\/pre>\n\n\n\n<p>In the above code, the executor is a function passed to&nbsp;<code>new Promise<\/code>. When&nbsp;<code>new Promise<\/code>&nbsp;is created, the executor runs automatically.<\/p>\n\n\n\n<p>Resolve and reject are two callbacks provided by JavaScript itself. They are called like this:<\/p>\n\n\n\n<p><strong>resolve(value): <\/strong>If the job is finished successfully.<br><strong>reject(error):<\/strong> If the job fails. <\/p>\n\n\n\n<p>The promise object can be created by the new Promise() constructor. It has the following two properties:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>State:<\/strong> Initially it is pending, then changes to either &#8220;fulfilled&#8221; when resolve is called or &#8220;rejected&#8221; when reject is called.<\/li>\n\n\n\n<li><strong>Result:<\/strong> Initially undefined, the changes to value if resolved or error when rejected. <\/li>\n<\/ul>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h3 class=\"wp-block-heading index-title\">then, catch, and finally Methods<\/h3>\n<\/div><\/div>\n\n\n\n<p><strong>then:<\/strong> It is used to display the resolved data after the fulfillment of promises.<\/p>\n\n\n\n<p>The syntax of .then() is:<\/p>\n\n\n\n<p>promise.then( function(result){\/*handle*\/},<br>                    function(error){\/*handle*\/}<br>);<br><\/p>\n\n\n\n<p>If we are interested only in successful completions, we can provide only one function argument to<br>.then();<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">let promise = new Promise( resolve =&gt; {\nSetTimeout( () =&gt; resolve(\u201cdone\u201d), 1000);\n});\npromise.then(alert);<\/pre>\n\n\n\n<p>If we are interested only in errors, we can use null as the first argument: then(null, f) <\/p>\n\n\n\n<p><strong>Or<\/strong>, we can use .catch() method: <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">promise.catch(alert);<\/pre>\n\n\n\n<p><strong>catch: <\/strong> It is used when a promise is rejected. You can handle errors using .catch() function.<\/p>\n\n\n\n<p><strong>finally:<\/strong> It is used to perform general cleanups. When we want to do something after either a promise is resolved or rejected, we can use the .finally() method:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">promise.finally( () =&gt; {\n   \/\/do something..\n});<\/pre>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h3 class=\"wp-block-heading index-title\">Promise Chaining:<\/h3>\n<\/div><\/div>\n\n\n\n<p>We can chain promises and make then pass the resolved values to one another like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">p.then( function( result ) =&gt; {\nalert(result); return 2;\n}).then\u2026 \/\/ Here p is a promise.<\/pre>\n\n\n\n<p>The idea is to pass the result through the chain of .then handlers.<\/p>\n\n\n\n<p><strong>Here is the flow of execution: <\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The initial promise resolves in 1 second (Assumption).<\/li>\n\n\n\n<li>The next .then() handler is then called, which returns a new promise (resolved with 2 values).<\/li>\n\n\n\n<li>The next .then() gets the result of the previous one and this keeps on going.<\/li>\n<\/ol>\n\n\n\n<p>Every call to .then( ) returns a new promise whose value is passed to the next one and so on. We can even create custom promises inside .then()<\/p>\n\n\n\n<p>We can attach multiple handlers to one promise. They don\u2019t pass the result to each other; instead they process it independently.<br>let p is a promise.<br>p.then(handler1)<br>p.then(handler2)<br>p.then(handler3)<\/p>\n\n\n\n<p><br>All above handlers run independently.<\/p>\n\n\n\n<div class=\"wk-index-wrap\"><div class=\"block-wrap\">\n<h3 class=\"wp-block-heading index-title\">Promise API:<\/h3>\n<\/div><\/div>\n\n\n\n<p>There are 6 static methods of Promise class: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Promise.all(promises):<\/strong> Waits for all promises to resolve and returns the array of their results. If anyone fails, it becomes an error &amp; all other results are ignored.<\/li>\n\n\n\n<li><strong>Promise.allSettled(promises):<\/strong> Waits for all the promises to settle and returns their results as an<br>array of objects with status and value.<\/li>\n\n\n\n<li><strong>Promise.race(promises):<\/strong> Waits for a first promise to settle and its result\/error becomes the outcome.<\/li>\n\n\n\n<li>P<strong>romise.any(promises):<\/strong> Waits for the first promise to be fulfilled (or not rejected), and its result becomes the outcome. Throws an Aggregate Error if all the promises are rejected.<\/li>\n\n\n\n<li><strong>Promise.resolve(value):<\/strong> Makes a resolved promise with the given value.<\/li>\n\n\n\n<li><strong>Promise.reject(error):<\/strong> Makes a rejected promise with the given value.<\/li>\n<\/ol>\n\n\n\n<p>If you need custom\u00a0<a href=\"https:\/\/webkul.com\/website-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress Development services<\/a>\u00a0or <a href=\"https:\/\/webkul.com\/wordpress-theme-development-services\/\">Theme Development Service<\/a> then feel free to\u00a0<a href=\"https:\/\/webkul.com\/contacts\" target=\"_blank\" rel=\"noreferrer noopener\">reach us<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript is single-threaded, which means two bits of the script cannot run at the same time. They run one after another. A Promise is an object that allows you to associate handlers with an asynchronous action&#8217;s eventual success value or failure reason. Before proceeding, we should know about what is the difference between synchronous and <a href=\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":505,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[198,1260],"tags":[1258,13679,1501],"class_list":["post-372811","post","type-post","status-publish","format-standard","hentry","category-javascript","category-wordpress","tag-wordpress","tag-wordpress-development-services","tag-wordpress-plugin"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Promises in JavaScript - 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\/promises-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Promises in JavaScript - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"JavaScript is single-threaded, which means two bits of the script cannot run at the same time. They run one after another. A Promise is an object that allows you to associate handlers with an asynchronous action&#8217;s eventual success value or failure reason. Before proceeding, we should know about what is the difference between synchronous and [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\" \/>\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=\"2023-03-29T14:03:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-06T06:26:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Raushan Kumar Paswan\" \/>\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=\"Raushan Kumar Paswan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\"},\"author\":{\"name\":\"Raushan Kumar Paswan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/db36277344bb56e4917bf0211aec8793\"},\"headline\":\"Promises in JavaScript\",\"datePublished\":\"2023-03-29T14:03:10+00:00\",\"dateModified\":\"2024-06-06T06:26:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\"},\"wordCount\":641,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"wordpress\",\"wordpress development services\",\"wordpress plugin\"],\"articleSection\":[\"JavaScript\",\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/promises-in-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\",\"url\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\",\"name\":\"Promises in JavaScript - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2023-03-29T14:03:10+00:00\",\"dateModified\":\"2024-06-06T06:26:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/promises-in-javascript\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/promises-in-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Promises in JavaScript\"}]},{\"@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\/db36277344bb56e4917bf0211aec8793\",\"name\":\"Raushan Kumar Paswan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ce9851ee21ba1ce546af25d566be4dffeaa3d4f8a1be72688619265ad326a321?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\/ce9851ee21ba1ce546af25d566be4dffeaa3d4f8a1be72688619265ad326a321?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Raushan Kumar Paswan\"},\"description\":\"Raushan specializes in WordPress SaaS Development and Shipping Method services, delivering scalable solutions that streamline eCommerce operations. Expertise drives enhanced digital presence and empowers businesses to achieve sustained growth.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/raushankrpaswan-wp333\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Promises in JavaScript - 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\/promises-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Promises in JavaScript - Webkul Blog","og_description":"JavaScript is single-threaded, which means two bits of the script cannot run at the same time. They run one after another. A Promise is an object that allows you to associate handlers with an asynchronous action&#8217;s eventual success value or failure reason. Before proceeding, we should know about what is the difference between synchronous and [...]","og_url":"https:\/\/webkul.com\/blog\/promises-in-javascript\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-03-29T14:03:10+00:00","article_modified_time":"2024-06-06T06:26:24+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Raushan Kumar Paswan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Raushan Kumar Paswan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/promises-in-javascript\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/promises-in-javascript\/"},"author":{"name":"Raushan Kumar Paswan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/db36277344bb56e4917bf0211aec8793"},"headline":"Promises in JavaScript","datePublished":"2023-03-29T14:03:10+00:00","dateModified":"2024-06-06T06:26:24+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/promises-in-javascript\/"},"wordCount":641,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["wordpress","wordpress development services","wordpress plugin"],"articleSection":["JavaScript","WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/promises-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/promises-in-javascript\/","url":"https:\/\/webkul.com\/blog\/promises-in-javascript\/","name":"Promises in JavaScript - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2023-03-29T14:03:10+00:00","dateModified":"2024-06-06T06:26:24+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/promises-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/promises-in-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/promises-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Promises in JavaScript"}]},{"@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\/db36277344bb56e4917bf0211aec8793","name":"Raushan Kumar Paswan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ce9851ee21ba1ce546af25d566be4dffeaa3d4f8a1be72688619265ad326a321?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\/ce9851ee21ba1ce546af25d566be4dffeaa3d4f8a1be72688619265ad326a321?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Raushan Kumar Paswan"},"description":"Raushan specializes in WordPress SaaS Development and Shipping Method services, delivering scalable solutions that streamline eCommerce operations. Expertise drives enhanced digital presence and empowers businesses to achieve sustained growth.","url":"https:\/\/webkul.com\/blog\/author\/raushankrpaswan-wp333\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/372811","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\/505"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=372811"}],"version-history":[{"count":18,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/372811\/revisions"}],"predecessor-version":[{"id":445949,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/372811\/revisions\/445949"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=372811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=372811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=372811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}