{"id":96151,"date":"2023-09-26T06:52:58","date_gmt":"2023-09-26T04:52:58","guid":{"rendered":"https:\/\/code-maze.com\/?p=96151"},"modified":"2023-09-26T06:52:58","modified_gmt":"2023-09-26T04:52:58","slug":"csharp-how-to-use-discard-variable","status":"publish","type":"post","link":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/","title":{"rendered":"Using a Discard Variable in C#"},"content":{"rendered":"<p>In this article, we are going to learn about the differences between a discard variable and the usual variables in C#. We will also see some practical uses of a discard.\u00a0<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/csharp-intermediate-topics\/UsingADiscardVariableInCSharp\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>C# 7 introduced <strong>discards as placeholders for values we do not have any use for in our code<\/strong>. They are write-only variables that allow us to explicitly inform the compiler or anyone reading our code to discard their content. They are particularly useful in scenarios where we receive a value but have no intention of using it.<\/p>\n<h2>How a Discard Variable Differs From a Usual Variable<\/h2>\n<p>A discard is represented by the underscore (<code>_<\/code>) character:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">_ = \"This is the syntax for a discard\";<\/code><\/p>\n<p>Discards are like unassigned variables. But unlike normal variables, we cannot declare discards with <code>var<\/code> or any type keyword.<\/p>\n<p>We can have more than one discard within a scope. We use each underscore placeholder to discard a single value. Even though it looks like discards have values, when we attempt to retrieve any of them, we get a compiler error: <code>CS0103: The name '_' doesn't exist in the current context<\/code>.\u00a0<\/p>\n<p><strong>We should note that declaring an underscore with a <code>var<\/code> or other types makes it a regular variable and loses its discard functionality:<\/strong><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">string _ = \"This is no longer a discard\";<\/code><\/p>\n<h2>Why Do We Use a Discard Variable?<\/h2>\n<p>If we ignore the discards, why do we need them?<\/p>\n<p>Discards help us maintain a clean codebase with minimized warnings. When we call a method with a return value we do not care for, assigning that value to a discard takes care of compiler warnings about unused variables. Some APIs and libraries also return unwanted values. We employ discards to manage them and still conform to the API\/library signatures.<\/p>\n<p>When working with pattern matching and deconstruction, discards allow us to ignore parts of a data structure that are irrelevant to us.\u00a0<\/p>\n<p>They are a feature that contributes to simplifying our codes and improving clarity.<\/p>\n<h2>Use Cases for Using a Discard Variable in C#<\/h2>\n<div class=\"heading-wrapper\" data-heading-level=\"h2\">\n<p>Using a discard in our code effectively communicates our intention to the compiler and other code readers. It signifies that we deliberately intend to disregard the outcome of an expression.<\/p>\n<p>We could ignore the result of an expression, one or more elements within a tuple expression, an <code>out<\/code> parameter in a method or the target of a pattern-matching expression.<\/p>\n<p>Let&#8217;s explore various scenarios where discards come in handy.<\/p>\n<h3>Discards as Out Parameters<\/h3>\n<p>We can discard the value of an <code>out<\/code> parameter when calling any method that uses one.\u00a0<\/p>\n<p>For example, a <code>TryParse()<\/code> returns a <code>bool<\/code>. If the parse is successful, it returns true and saves the value of the parsed argument to the <code>out<\/code> parameter:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static (bool result, string errorMessage) GetNumber(string input)\r\n{\r\n    bool result = int.TryParse(input, out _);\r\n\r\n    if (!result)\r\n    {\r\n        return (false, \"Not a valid number\");\r\n    }\r\n\r\n    return (true, \"\");\r\n}<\/pre>\n<p>In our example, we use <code>int.TryParse()<\/code> to attempt to parse an input, which is a <code>string<\/code> by default. We use discard for the <code>out<\/code> parameter to indicate that we are not interested in the parsed integer value. We are only checking if the parse was successful or not.\u00a0<\/p>\n<h3 id=\"tuple-and-object-deconstruction\" class=\"heading-anchor\">Discards in Tuple Deconstruction<\/h3>\n<p>When working with <a href=\"https:\/\/code-maze.com\/csharp-tuple\/\" target=\"_blank\" rel=\"noopener\">tuples<\/a>, we often do not require all the values they contain. So, let&#8217;s start with a simple method:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static (int, int, int) GetSum(int num1, int num2)\r\n{\r\n    return (num1, num2, num1 + num2);\r\n}<\/pre>\n<p>The <code>GetSum()<\/code> method returns a three-tuple containing the numbers to be added and the resulting sum.\u00a0<\/p>\n<p>Using a discard, <strong>we can selectively ignore the specific tuple elements<\/strong> we want and use actual identifiers for the values we care about:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var (_, _, sum) = DiscardExamples.GetSum(9, 89);<\/code><\/p>\n<p>Since the two numbers are already passed into <code>GetSum()<\/code> when we call it, we do not need their values returned. Our interest is obtaining the sum, so we designate the other two numbers as discards.<\/p>\n<h3>Discards in Pattern Matching<\/h3>\n<p>Given an array of items containing various data types, we can use <a href=\"https:\/\/code-maze.com\/csharp-pattern-matching\/\" target=\"_blank\" rel=\"noopener\">pattern matching<\/a> within a <code>switch<\/code> expression to identify the type of each item:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static void GetType(object[] objects)\r\n{\r\n    foreach (var item in objects)\r\n    {\r\n        Console.WriteLine(item switch\r\n        {\r\n            string =&gt; \"it's a string\",\r\n            int =&gt; \"it's an int\",\r\n            _ =&gt; \"Neither string nor int\"\r\n        });  \r\n    }\r\n}<\/pre>\n<p>Our method checks if the items in our array are a <code>string<\/code> or an <code>integer<\/code>.\u00a0 We treat any other data type as a discard, so the method will print <code>Neither string nor int<\/code>\u00a0to the console.<\/p>\n<h3>Discards in Lambda Expressions<\/h3>\n<p id=\"tuple-and-object-deconstruction\" class=\"heading-anchor\">From C# 9, we can use discards to represent two or more unused input parameters of a <a href=\"https:\/\/code-maze.com\/lambda-expressions-in-csharp\/\" target=\"_blank\" rel=\"noopener\">lambda expression<\/a>:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">Func&lt;char, char, char&gt; constant = (_, _) =&gt; 'C';<\/code><\/p>\n<p>To maintain compatibility for lambda expressions written in older versions of C#, when a single input parameter is assigned the <code>_<\/code> identifier, it is interpreted as a valid read\/write variable in newer versions.<\/p>\n<h2>Conclusion<\/h2>\n<p>Using the discard <code>_<\/code> in our code conveys to the compiler that we mean to disregard the outcome of an expression deliberately. It proves especially handy in situations where we receive a value but have no plans to utilize it.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we are going to learn about the differences between a discard variable and the usual variables in C#. We will also see some practical uses of a discard.\u00a0 C# 7 introduced discards as placeholders for values we do not have any use for in our code. They are write-only variables that allow [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[12,506],"tags":[1811,1963],"class_list":["post-96151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-csharp","category-intermediate","tag-c","tag-discard","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using a Discard Variable in C# - Code Maze<\/title>\n<meta name=\"description\" content=\"In this article, we will learn the difference between a discard variable and the usual variables in C#. We will also see practical use cases.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using a Discard Variable in C# - Code Maze\" \/>\n<meta property=\"og:description\" content=\"In this article, we will learn the difference between a discard variable and the usual variables in C#. We will also see practical use cases.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-26T04:52:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\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\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"Using a Discard Variable in C#\",\"datePublished\":\"2023-09-26T04:52:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\"},\"wordCount\":733,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\"C#\",\"discard\"],\"articleSection\":[\"C#\",\"Intermediate\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\",\"url\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\",\"name\":\"Using a Discard Variable in C# - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2023-09-26T04:52:58+00:00\",\"description\":\"In this article, we will learn the difference between a discard variable and the usual variables in C#. We will also see practical use cases.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using a Discard Variable in C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using a Discard Variable in C# - Code Maze","description":"In this article, we will learn the difference between a discard variable and the usual variables in C#. We will also see practical use cases.","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:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/","og_locale":"en_US","og_type":"article","og_title":"Using a Discard Variable in C# - Code Maze","og_description":"In this article, we will learn the difference between a discard variable and the usual variables in C#. We will also see practical use cases.","og_url":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/","og_site_name":"Code Maze","article_published_time":"2023-09-26T04:52:58+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"Using a Discard Variable in C#","datePublished":"2023-09-26T04:52:58+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/"},"wordCount":733,"commentCount":0,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":["C#","discard"],"articleSection":["C#","Intermediate"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/","url":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/","name":"Using a Discard Variable in C# - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2023-09-26T04:52:58+00:00","description":"In this article, we will learn the difference between a discard variable and the usual variables in C#. We will also see practical use cases.","breadcrumb":{"@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/csharp-how-to-use-discard-variable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Using a Discard Variable in C#"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/96151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=96151"}],"version-history":[{"count":3,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/96151\/revisions"}],"predecessor-version":[{"id":96224,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/96151\/revisions\/96224"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=96151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=96151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=96151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}