{"id":65262,"date":"2022-02-10T07:18:10","date_gmt":"2022-02-10T06:18:10","guid":{"rendered":"https:\/\/drafts.code-maze.com\/?p=65262"},"modified":"2022-07-13T12:05:12","modified_gmt":"2022-07-13T10:05:12","slug":"csharp-initialize-arrays","status":"publish","type":"post","link":"https:\/\/code-maze.com\/csharp-initialize-arrays\/","title":{"rendered":"Different Ways to Initialize Arrays in C#"},"content":{"rendered":"<p>Arrays are data structures that help programmers store multiple values of a specific type in a single variable. We can use different techniques to initialize arrays in C#, and we are going to discuss them in this article.<\/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\/collections-arrays\/InitializeArrays\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s start<\/p>\n<h2><strong><a id=\"known-number-of-elements\"><\/a>Initialize Arrays in C# with Known Number of Elements<\/strong><\/h2>\n<p>We can initialize an array with its type and size:\u00a0<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var students = new string[2];<\/code><\/p>\n<p>Here, we initialize and specify the size of the string array. i.e. 2.\u00a0 We can use this technique in situations where we know the number of elements in an array but we don&#8217;t know the values.<\/p>\n<p>We can test that the array has a length of 2:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public void GivenArrayOfFixedLength_ThenReturnCorrectLength()\r\n{\r\n    var students = new string[2];\r\n\r\n    Assert.AreEqual(2, students.Length);\r\n}<\/pre>\n<p>Of course, if we just want to create an array without elements we can provide 0 for the size, or we can use <code>Array.Emtpy&lt;T&gt;<\/code> method:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">[TestMethod]\r\npublic void GivenEmptyArray_ThenReturnCorrectLength()\r\n{\r\n    var students = new string[0];\r\n    var students1 = Array.Empty&lt;string&gt;();\r\n\r\n    Assert.AreEqual(0, students.Length);\r\n    Assert.AreEqual(0, students1.Length);\r\n}<\/pre>\n<h2><strong><a id=\"known-elements-values\"><\/a>Defining and Adding Values to an Array<\/strong><\/h2>\n<p>In scenarios where we know the size and the values that we want to add to an array, we can initialize our array differently:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var students = new string[2] {\"John\", \"Doe\"};<\/code><\/p>\n<p>We can see that not only do we specify the length but also add two <code>string<\/code> values directly to the <code>students<\/code> array during the initialization process.<\/p>\n<p>Let&#8217;s validate that the length of the <code>students<\/code> array is two:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">[TestMethod]\r\npublic void GivenLengthAndValues_ThenReturnCorrectLength()\r\n{\r\n    var students = new string[2] {\"John\", \"Doe\"};\r\n\r\n    Assert.AreEqual(2, students.Length);\r\n}<\/pre>\n<h2><strong><a id=\"defining-through-elements\"><\/a>Defining an Array With Elements<\/strong><\/h2>\n<p>Let&#8217;s assume we have a list of student names that we intend to store in an array. However, we don&#8217;t know how many names we have to store. We can initialize the same array with values without specifying the length of the array:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var students = new string[] {\"John\", \"Doe\"};<\/code><\/p>\n<p>We can also achieve the same result using different techniques:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">string[] teachers = {\"Peter\", \"John\"};\r\nvar parents = new[] {\"Mary\", \"Martha\"};<\/pre>\n<p>Now, we can write some tests to verify that each array has a length of two:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">[TestMethod]\r\npublic void GivenArrayValues_ThenCreateArrayOfFixedLength()\r\n{\r\n    var students = new string[] {\"John\", \"Doe\"};\r\n    string[] teachers = {\"Peter\", \"John\"};\r\n    var parents = new[] {\"Mary\", \"Martha\"};\r\n\r\n    Assert.AreEqual(2, students.Length);\r\n    Assert.AreEqual(2, parents.Length);\r\n    Assert.AreEqual(2, teachers.Length);\r\n}<\/pre>\n<p>With our example, we can prove that we can initialize an array directly with values. The compiler infers the array&#8217;s length during runtime. Therefore, we do not need to specify the number of elements while initializing it.\u00a0<\/p>\n<h2><strong><a id=\"extensions\"><\/a>Initializing Arrays Through Extensions<\/strong><\/h2>\n<p>Assuming we have data from complex data structures that we need to convert into arrays, we can use the inbuilt <code>ToArray()<\/code> extension method to convert an object into an array. Let&#8217;s assume we have a <code>List&lt;string&gt;<\/code> object that we need to convert into an array:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var studentList = new List&lt;string&gt; {\"John\", \"Doe\"};<\/code><\/p>\n<p>We can use the <code>ToArray()<\/code> extension to convert the <code>studentList<\/code> object into an array and verify that it has two values:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">[TestMethod]\r\npublic void GivenListValues_ThenConvertToArray()\r\n{\r\n    var studentList = new List&lt;string&gt; {\"John\", \"Doe\"};\r\n    var students = studentList.ToArray();\r\n\r\n    Assert.AreEqual(2, students.Length);\r\n}<\/pre>\n<h2><a id=\"techniques-to-use\"><\/a>Should we Use List or Array<\/h2>\n<p>In situations where we are<strong> not sure of the number of elements and the values<\/strong> that we are going to store in an array, collections such as lists are the best options. These collections are memory-efficient as they can scale as the number of elements changes and we can <a href=\"#extensions\">convert<\/a> them into arrays.\u00a0<\/p>\n<p>Besides that, in scenarios where <strong>we know the number of elements or intend to initialize an array with its values<\/strong>, we can use the techniques we have discussed above.\u00a0<\/p>\n<h2><a id=\"conclusion\"><\/a>Conclusion<\/h2>\n<p>In this article, we have learned how to initialize arrays in C# using different techniques. Additionally, we&#8217;ve shown several tests to prove the size of our initialized arrays.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arrays are data structures that help programmers store multiple values of a specific type in a single variable. We can use different techniques to initialize arrays in C#, and we are going to discuss them in this article. Let&#8217;s start Initialize Arrays in C# with Known Number of Elements We can initialize an array with [&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":[1057,12],"tags":[1043,946,1061,1062],"class_list":["post-65262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-array","category-csharp","tag-array","tag-collections","tag-declaring-arrays","tag-initializing-arrays","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>Different Ways to Initialize Arrays in C# - Code Maze<\/title>\n<meta name=\"description\" content=\"In this article, we are going to talk about different techniques that we can use to initialize arrays in C#.\" \/>\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-initialize-arrays\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Different Ways to Initialize Arrays in C# - Code Maze\" \/>\n<meta property=\"og:description\" content=\"In this article, we are going to talk about different techniques that we can use to initialize arrays in C#.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/csharp-initialize-arrays\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-10T06:18:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-13T10:05:12+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=\"3 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-initialize-arrays\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"Different Ways to Initialize Arrays in C#\",\"datePublished\":\"2022-02-10T06:18:10+00:00\",\"dateModified\":\"2022-07-13T10:05:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/\"},\"wordCount\":520,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\"Array\",\"collections\",\"declaring arrays\",\"initializing arrays\"],\"articleSection\":[\"Array\",\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/csharp-initialize-arrays\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/\",\"url\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/\",\"name\":\"Different Ways to Initialize Arrays in C# - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2022-02-10T06:18:10+00:00\",\"dateModified\":\"2022-07-13T10:05:12+00:00\",\"description\":\"In this article, we are going to talk about different techniques that we can use to initialize arrays in C#.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/csharp-initialize-arrays\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/csharp-initialize-arrays\/#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-initialize-arrays\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Different Ways to Initialize Arrays 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":"Different Ways to Initialize Arrays in C# - Code Maze","description":"In this article, we are going to talk about different techniques that we can use to initialize arrays in C#.","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-initialize-arrays\/","og_locale":"en_US","og_type":"article","og_title":"Different Ways to Initialize Arrays in C# - Code Maze","og_description":"In this article, we are going to talk about different techniques that we can use to initialize arrays in C#.","og_url":"https:\/\/code-maze.com\/csharp-initialize-arrays\/","og_site_name":"Code Maze","article_published_time":"2022-02-10T06:18:10+00:00","article_modified_time":"2022-07-13T10:05:12+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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"Different Ways to Initialize Arrays in C#","datePublished":"2022-02-10T06:18:10+00:00","dateModified":"2022-07-13T10:05:12+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/"},"wordCount":520,"commentCount":0,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":["Array","collections","declaring arrays","initializing arrays"],"articleSection":["Array","C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/csharp-initialize-arrays\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/","url":"https:\/\/code-maze.com\/csharp-initialize-arrays\/","name":"Different Ways to Initialize Arrays in C# - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2022-02-10T06:18:10+00:00","dateModified":"2022-07-13T10:05:12+00:00","description":"In this article, we are going to talk about different techniques that we can use to initialize arrays in C#.","breadcrumb":{"@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/csharp-initialize-arrays\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/csharp-initialize-arrays\/#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-initialize-arrays\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Different Ways to Initialize Arrays 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\/65262","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=65262"}],"version-history":[{"count":6,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/65262\/revisions"}],"predecessor-version":[{"id":68396,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/65262\/revisions\/68396"}],"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=65262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=65262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=65262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}