

{"id":120271,"date":"2023-11-14T18:00:44","date_gmt":"2023-11-14T12:30:44","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120271"},"modified":"2023-11-14T18:24:09","modified_gmt":"2023-11-14T12:54:09","slug":"swift-arrays-tutorial","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/","title":{"rendered":"Swift Arrays Tutorial"},"content":{"rendered":"<p>Arrays are one of the collection type data types in Swift. It stores and manages data elements. They are ordered collections of elements. In Swift, the index of arrays starts from 0, so they are zero-indexed.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var arrayExample: [String] = [\"DataFlair\", \"Swift\", \"Data Types\", \"Array\"]<\/pre>\n<h2>Array Creation in Swift<\/h2>\n<p>We create an array by defining the data type of the elements of the array within squared brackets [], as shown in the given example.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var array: [Int] = [20, 23]<\/pre>\n<h3>Creating Empty Array<\/h3>\n<p>We create an empty array by declaring an array data type variable and assigning empty square brackets.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var emptyArray: [String] = []<\/pre>\n<p>We can add values to the array after its declaration.<\/p>\n<h3>Creating an Array with default repeating values<\/h3>\n<p>Swift provides a unique way to create an array with default repeating values. We make such arrays by giving values to the two parameters in the declaration. The parameters are repeating and counting. The repeating parameter takes the value, and the count parameter takes the number of elements in the array.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example: [String] = [String](repeating: \"DataFlair\", count: 4)\r\nprint(example)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;DataFlair&#8221;, &#8220;DataFlair&#8221;, &#8220;DataFlair&#8221;, &#8220;DataFlair&#8221;]<\/p>\n<h3>Type Inference<\/h3>\n<p>Type inference helps us deduce an array&#8217;s data type based on its initial value. We can omit the type annotation during declaration, and Swift will infer the type for us.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example = [\"DataFlair\", \"Swift\"]<\/pre>\n<p>For instance, in the above example, Swift will deduce the data type. It will infer the data type of the variable example as an array of strings.<\/p>\n<h3>Accessing Array Values<\/h3>\n<p>We use indices to access array element values. The index starts from zero in Swift.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example = [\"DataFlair\", \"Swift\", \"Collections\"]\r\nprint(\"Index 0:\", example[0])\r\nprint(\"Index 1:\", example[1])\r\nprint(\"Index 2:\", example[2])<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Index 0:<\/strong> DataFlair<br \/>\n<strong>Index 1:<\/strong> Swift<br \/>\n<strong>Index 2:<\/strong> Collections<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Element Value<\/b><\/td>\n<td><b>DataFlair<\/b><\/td>\n<td><b>Swift<\/b><\/td>\n<td><b>Collections<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Index<\/b><\/td>\n<td><b>0<\/b><\/td>\n<td><b>1<\/b><\/td>\n<td><b>2<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td><b>Element Value<\/b><\/td>\n<td><b>DataFlair<\/b><\/td>\n<td><b>Swift<\/b><\/td>\n<td><b>Collections<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Index<\/b><\/td>\n<td><b>0<\/b><\/td>\n<td><b>1<\/b><\/td>\n<td><b>2<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The above diagram displays how every element is stored in an array associated with its index.<\/p>\n<h3>Add Elements to Array<\/h3>\n<p>We can add elements to the array. We can do this by using the built-in methods provided by Swift. <strong>The methods are as follows.<\/strong><\/p>\n<h4>Using append()<\/h4>\n<p>We can add a new element at the end of the array using the append() function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example = [\"DataFlair\", \"Swift\"]\r\nprint(example)\r\nexample.append(\"Collections\")\r\nprint(example)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;DataFlair&#8221;, &#8220;Swift&#8221;]<br \/>\n[&#8220;DataFlair&#8221;, &#8220;Swift&#8221;, &#8220;Collections&#8221;]<\/p>\n<p>We can also add the contents of one array into another. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example1 = [\"DataFlair 1\", \"Swift 1\"]\r\nprint(example1)\r\nvar example2 = [\"DataFlair 2\", \"Swift 2\"]\r\nexample1.append(contentsOf: example2)\r\nprint(example1)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;DataFlair 1&#8221;, &#8220;Swift 1&#8221;]<br \/>\n[&#8220;DataFlair 1&#8221;, &#8220;Swift 1&#8221;, &#8220;DataFlair 2&#8221;, &#8220;Swift 2&#8221;]<\/p>\n<h4>Using insert()<\/h4>\n<p>We can add a new element at a given index of the array using the insert() function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example = [\"DataFlair\", \"Swift\"]\r\nprint(example)\r\nexample.insert(\"Collections\", at: 1)\r\nprint(example)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;DataFlair&#8221;, &#8220;Swift&#8221;]<br \/>\n[&#8220;DataFlair&#8221;, &#8220;Collections&#8221;, &#8220;Swift&#8221;]<\/p>\n<h3>Modify array elements<\/h3>\n<p>We can modify an element in the array by reassigning a new value to it.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var example = [\"DataFlair\", \"Swift\"]\r\nprint(example)\r\nexample[1] = \"Collections\"\r\nprint(example)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;DataFlair&#8221;, &#8220;Swift&#8221;]<br \/>\n[&#8220;DataFlair&#8221;, &#8220;Collections&#8221;]<\/p>\n<h3>Remove elements from Array<\/h3>\n<p>We can remove particular or all the elements from an array.<\/p>\n<p><strong>The below table depicts the methods provided by Swift for removing elements from an array.<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">remove()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes the element from the given index<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">removeFirst()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes the element at the start of the array<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">removeLast()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes the element from the rear part of the array<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">removeAll()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes all the elements in the array<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var removeExample = [2, 5, 8, 23, 45, 78]\r\nprint(\"Original Array\",removeExample)\r\nremoveExample.remove(at: 3)\r\nprint(\"Remove element from index 3\",removeExample)\r\nremoveExample.removeFirst()\r\nprint(\"Remove First element\",removeExample)\r\nremoveExample.removeLast()\r\nprint(\"Remove Last element\",removeExample)\r\nremoveExample.removeAll()\r\nprint(\"Remove All elements\",removeExample)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Original Array [2, 5, 8, 23, 45, 78]<br \/>\nRemove element from index 3 [2, 5, 8, 45, 78]<br \/>\nRemove First element [5, 8, 45, 78]<br \/>\nRemove Last element [5, 8, 45]<br \/>\nRemove All elements []<\/p>\n<h3>Array Methods in Swift<\/h3>\n<p>Swift offers several inbuilt methods for arrays. <strong>The table below depicts these methods<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">count<\/span><\/td>\n<td><span style=\"font-weight: 400\">Counts the length of the array<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isEmpty<\/span><\/td>\n<td><span style=\"font-weight: 400\">True if the empty array is checked; otherwise, returns false<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">contains()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns true if an element is present in the array otherwise, false<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">reverse()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Reverses the array<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sort()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sorts the elements in the array<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var arrayExample = [\"DataFlair\", \"Swift\", \"Collections\"]\r\nprint(\"Count:\", arrayExample.count)\r\nprint(\"Is Empty:\", arrayExample.isEmpty)\r\nprint(\"Contains element:\", arrayExample.contains(\"DataFlair\"))<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Count:<\/strong> 3<br \/>\n<strong>Is Empty:<\/strong> false<br \/>\n<strong>Contains element:<\/strong> true<\/p>\n<h3>Loops and Arrays in Swift<\/h3>\n<p>We can use a for-in loop to iterate through the elements of the array. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var arrayExample = [\"DataFlair\", \"Swift\", \"Collections\"]\r\nfor element in arrayExample{\r\n    print(element)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>DataFlair<br \/>\nSwift<br \/>\nCollections<\/p>\n<h3>Joining Arrays<\/h3>\n<p>We can join two arrays using the \u2018+\u2019 operator. The elements of one array are added to another array.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var arrayExample1 = [\"DataFlair\", \"Swift\", \"Collections\"]\r\nvar arrayExample2 = [\"Arrays\", \"Sets\"]\r\nvar arrayExample = arrayExample1 + arrayExample2\r\nprint(arrayExample)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;DataFlair&#8221;, &#8220;Swift&#8221;, &#8220;Collections&#8221;, &#8220;Arrays&#8221;, &#8220;Sets&#8221;]<\/p>\n<h3>Conclusion<\/h3>\n<p>Arrays are the collection data types in Swift. They are used to manage multiple elements in an ordered manner. In this article, we learn how to create and access. We can add, modify and remove elements. Swift provides several inbuilt features and methods to handle elements effectively.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arrays are one of the collection type data types in Swift. It stores and manages data elements. They are ordered collections of elements. In Swift, the index of arrays starts from 0, so they&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120273,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27789],"tags":[28447,28446,28445,28287],"class_list":["post-120271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift-tutorials","tag-array-methods","tag-arrays-in-swift","tag-swift-arrays","tag-swift-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift Arrays Tutorial - DataFlair<\/title>\n<meta name=\"description\" content=\"Arrays are the collection data types in Swift. They are used to manage multiple elements in an ordered manner.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift Arrays Tutorial - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Arrays are the collection data types in Swift. They are used to manage multiple elements in an ordered manner.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-14T12:30:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-14T12:54:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-arrays.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift Arrays Tutorial - DataFlair","description":"Arrays are the collection data types in Swift. They are used to manage multiple elements in an ordered manner.","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:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Swift Arrays Tutorial - DataFlair","og_description":"Arrays are the collection data types in Swift. They are used to manage multiple elements in an ordered manner.","og_url":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-11-14T12:30:44+00:00","article_modified_time":"2023-11-14T12:54:09+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-arrays.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Swift Arrays Tutorial","datePublished":"2023-11-14T12:30:44+00:00","dateModified":"2023-11-14T12:54:09+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/"},"wordCount":645,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-arrays.webp","keywords":["array methods","arrays in swift","swift arrays","swift tutorials"],"articleSection":["Swift Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/","url":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/","name":"Swift Arrays Tutorial - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-arrays.webp","datePublished":"2023-11-14T12:30:44+00:00","dateModified":"2023-11-14T12:54:09+00:00","description":"Arrays are the collection data types in Swift. They are used to manage multiple elements in an ordered manner.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-arrays.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-arrays.webp","width":1200,"height":628,"caption":"swift arrays"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/swift-arrays-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Swift Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/swift-tutorials\/"},{"@type":"ListItem","position":3,"name":"Swift Arrays Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=120271"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120271\/revisions"}],"predecessor-version":[{"id":125806,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120271\/revisions\/125806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120273"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}