{"id":258528,"date":"2024-06-24T04:56:15","date_gmt":"2024-06-24T04:56:15","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/?p=258528"},"modified":"2024-06-24T04:56:15","modified_gmt":"2024-06-24T04:56:15","slug":"how-to-get-value-from-object-array-in-typescript","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/","title":{"rendered":"How to get value from object array in TypeScript?"},"content":{"rendered":"<p>How to Get Value from Object Array in TypeScript?<\/p>\n<p>TypeScript is an open-source programming language that&#8217;s increasingly being used for building robust web applications. One common task in TypeScript is to work with object arrays, where you may need to retrieve specific values from the array. In this article, we&#8217;ll explore the various ways to extract values from object arrays in TypeScript.<\/p>\n<p>**To get a value from an object array in TypeScript, you can use various methods such as dot notation, bracket notation, or the find method.**<\/p>\n<p>Let&#8217;s dive into each of these methods in more detail:<\/p>\n<p>**1. Dot Notation:** <br \/>\nThis method involves accessing a property value directly by using the dot operator (.) followed by the property name.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>console.log(myArray[0].name); \/\/ Output: John<br \/>\nconsole.log(myArray[2].age); \/\/ Output: 35<br \/>\n&#8220;`<\/p>\n<p>**2. Bracket Notation:**<br \/>\nIn TypeScript, you can also use bracket notation to access object properties by providing the property name as a string within square brackets ([]).<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>console.log(myArray[0][&#8216;name&#8217;]); \/\/ Output: John<br \/>\nconsole.log(myArray[2][&#8216;age&#8217;]); \/\/ Output: 35<br \/>\n&#8220;`<\/p>\n<p>**3. Find Method:**<br \/>\nWhen you want to retrieve a value based on certain conditions, you can use the find method in TypeScript. The find method returns the first element that satisfies the provided testing function.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>const found = myArray.find((item) => item.name === &#8216;Jane&#8217;);<br \/>\nconsole.log(found.age); \/\/ Output: 30<br \/>\n&#8220;`<\/p>\n<p>Now, let&#8217;s address some related frequently asked questions related to getting values from object arrays in TypeScript:<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#FAQs\" title=\"FAQs:\">FAQs:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q1_Can_I_access_object_properties_using_the_dot_notation_if_the_array_has_nested_objects\" title=\"Q1. Can I access object properties using the dot notation if the array has nested objects?\">Q1. Can I access object properties using the dot notation if the array has nested objects?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q2_What_if_the_property_I_want_to_access_is_dynamically_determined\" title=\"Q2. What if the property I want to access is dynamically determined?\">Q2. What if the property I want to access is dynamically determined?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q3_How_can_I_get_all_values_for_a_specific_property_from_an_array_of_objects\" title=\"Q3. How can I get all values for a specific property from an array of objects?\">Q3. How can I get all values for a specific property from an array of objects?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q4_What_if_the_property_I_want_to_access_is_optional_and_might_be_undefined\" title=\"Q4. What if the property I want to access is optional and might be undefined?\">Q4. What if the property I want to access is optional and might be undefined?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q5_How_can_I_get_all_unique_values_for_a_specific_property_from_an_array_of_objects\" title=\"Q5. How can I get all unique values for a specific property from an array of objects?\">Q5. How can I get all unique values for a specific property from an array of objects?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q6_How_can_I_retrieve_values_from_multiple_properties_in_one_go\" title=\"Q6. How can I retrieve values from multiple properties in one go?\">Q6. How can I retrieve values from multiple properties in one go?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q7_How_can_I_get_the_index_of_an_object_in_the_array_based_on_a_property_value\" title=\"Q7. How can I get the index of an object in the array based on a property value?\">Q7. How can I get the index of an object in the array based on a property value?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q8_How_can_I_check_if_a_specific_property_exists_in_an_object\" title=\"Q8. How can I check if a specific property exists in an object?\">Q8. How can I check if a specific property exists in an object?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q9_How_can_I_find_all_objects_in_an_array_that_satisfy_certain_criteria\" title=\"Q9. How can I find all objects in an array that satisfy certain criteria?\">Q9. How can I find all objects in an array that satisfy certain criteria?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q10_How_can_I_retrieve_the_first_or_last_element_from_an_object_array\" title=\"Q10. How can I retrieve the first or last element from an object array?\">Q10. How can I retrieve the first or last element from an object array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q11_How_can_I_check_if_an_object_array_is_empty\" title=\"Q11. How can I check if an object array is empty?\">Q11. How can I check if an object array is empty?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#Q12_How_can_I_get_the_total_count_of_objects_in_an_object_array\" title=\"Q12. How can I get the total count of objects in an object array?\">Q12. How can I get the total count of objects in an object array?<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"Q1_Can_I_access_object_properties_using_the_dot_notation_if_the_array_has_nested_objects\"><\/span>Q1. Can I access object properties using the dot notation if the array has nested objects?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can access nested object properties using multiple dot notations.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, address: { city: &#8216;New York&#8217; } },<br \/>\n  { name: &#8216;Jane&#8217;, address: { city: &#8216;London&#8217; } },<br \/>\n  { name: &#8216;Bob&#8217;, address: { city: &#8216;Paris&#8217; } }<br \/>\n];<\/p>\n<p>console.log(myArray[1].address.city); \/\/ Output: London<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q2_What_if_the_property_I_want_to_access_is_dynamically_determined\"><\/span>Q2. What if the property I want to access is dynamically determined?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIf the property name is dynamically determined, you can use the bracket notation and pass the property name as a variable.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>const propName = &#8216;age&#8217;;<br \/>\nconsole.log(myArray[2][propName]); \/\/ Output: 35<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q3_How_can_I_get_all_values_for_a_specific_property_from_an_array_of_objects\"><\/span>Q3. How can I get all values for a specific property from an array of objects?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use the map method in TypeScript to extract all the values for a specific property from an array of objects.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>const ages = myArray.map((item) => item.age);<br \/>\nconsole.log(ages); \/\/ Output: [25, 30, 35]<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q4_What_if_the_property_I_want_to_access_is_optional_and_might_be_undefined\"><\/span>Q4. What if the property I want to access is optional and might be undefined?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo handle optional properties that might be undefined, you can use optional chaining (?.) to safely access the value.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217; }<br \/>\n];<\/p>\n<p>console.log(myArray[2].age); \/\/ Output: undefined<br \/>\nconsole.log(myArray[2]?.age); \/\/ Output: undefined (no error)<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q5_How_can_I_get_all_unique_values_for_a_specific_property_from_an_array_of_objects\"><\/span>Q5. How can I get all unique values for a specific property from an array of objects?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo get unique values for a specific property, you can combine the map and Set objects in TypeScript.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 }<br \/>\n];<\/p>\n<p>const uniqueAges = [&#8230;new Set(myArray.map((item) => item.age))];<br \/>\nconsole.log(uniqueAges); \/\/ Output: [25, 30, 35]<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q6_How_can_I_retrieve_values_from_multiple_properties_in_one_go\"><\/span>Q6. How can I retrieve values from multiple properties in one go?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use destructuring assignment in TypeScript to extract multiple property values simultaneously.<br \/>\n&#8220;`typescript<br \/>\nconst myObject = { name: &#8216;John&#8217;, age: 25 };<br \/>\nconst { name, age } = myObject;<\/p>\n<p>console.log(name); \/\/ Output: John<br \/>\nconsole.log(age); \/\/ Output: 25<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q7_How_can_I_get_the_index_of_an_object_in_the_array_based_on_a_property_value\"><\/span>Q7. How can I get the index of an object in the array based on a property value?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nThe findIndex method in TypeScript helps you find the index of an object based on a property value.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>const index = myArray.findIndex((item) => item.name === &#8216;Jane&#8217;);<br \/>\nconsole.log(index); \/\/ Output: 1<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q8_How_can_I_check_if_a_specific_property_exists_in_an_object\"><\/span>Q8. How can I check if a specific property exists in an object?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use the &#8220;in&#8221; operator in TypeScript to check if a property exists in an object.<br \/>\n&#8220;`typescript<br \/>\nconst myObject = { name: &#8216;John&#8217;, age: 25 };<br \/>\nconsole.log(&#8216;name&#8217; in myObject); \/\/ Output: true<br \/>\nconsole.log(&#8216;address&#8217; in myObject); \/\/ Output: false<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q9_How_can_I_find_all_objects_in_an_array_that_satisfy_certain_criteria\"><\/span>Q9. How can I find all objects in an array that satisfy certain criteria?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use the filter method to find all objects in an array that satisfy certain criteria.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>const filteredArray = myArray.filter((item) => item.age > 30);<br \/>\nconsole.log(filteredArray); \/\/ Output: [{ name: &#8216;Bob&#8217;, age: 35 }]<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q10_How_can_I_retrieve_the_first_or_last_element_from_an_object_array\"><\/span>Q10. How can I retrieve the first or last element from an object array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo retrieve the first or last element from an object array, you can use array indexing.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>console.log(myArray[0]); \/\/ Output: { name: &#8216;John&#8217;, age: 25 }<br \/>\nconsole.log(myArray[myArray.length &#8211; 1]); \/\/ Output: { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q11_How_can_I_check_if_an_object_array_is_empty\"><\/span>Q11. How can I check if an object array is empty?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can check if an object array is empty by comparing its length to zero.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [];<\/p>\n<p>console.log(myArray.length === 0); \/\/ Output: true<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q12_How_can_I_get_the_total_count_of_objects_in_an_object_array\"><\/span>Q12. How can I get the total count of objects in an object array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo get the total count of objects in an object array, you can simply access its length property.<br \/>\n&#8220;`typescript<br \/>\nconst myArray = [<br \/>\n  { name: &#8216;John&#8217;, age: 25 },<br \/>\n  { name: &#8216;Jane&#8217;, age: 30 },<br \/>\n  { name: &#8216;Bob&#8217;, age: 35 }<br \/>\n];<\/p>\n<p>console.log(myArray.length); \/\/ Output: 3<br \/>\n&#8220;`<\/p>\n<p>In conclusion, TypeScript provides various methods to retrieve values from object arrays. Whether you choose dot notation, bracket notation, or the find method, understanding these techniques will help you efficiently work with object arrays in your TypeScript projects.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that&#8217;s increasingly being used for building robust web applications. One common task in TypeScript is to work with object arrays, where you may need to retrieve specific values from the array. In this article, we&#8217;ll explore the various ways to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to get value from object array in TypeScript?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#more-258528\">Read more<span class=\"screen-reader-text\">How to get value from object array in TypeScript?<\/span><\/a><\/p>\n","protected":false},"author":65,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-258528","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get value from object array in TypeScript?<\/title>\n<meta name=\"description\" content=\"How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that&#039;s increasingly being used for building robust web\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get value from object array in TypeScript?\" \/>\n<meta property=\"og:description\" content=\"How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that&#039;s increasingly being used for building robust web\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-24T04:56:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.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=\"Timothy Mathis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Timothy Mathis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\"},\"author\":{\"name\":\"Timothy Mathis\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\"},\"headline\":\"How to get value from object array in TypeScript?\",\"datePublished\":\"2024-06-24T04:56:15+00:00\",\"dateModified\":\"2024-06-24T04:56:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\"},\"wordCount\":954,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\",\"name\":\"How to get value from object array in TypeScript?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2024-06-24T04:56:15+00:00\",\"dateModified\":\"2024-06-24T04:56:15+00:00\",\"description\":\"How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that's increasingly being used for building robust web\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get value from object array in TypeScript?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\",\"name\":\"Timothy Mathis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Timothy Mathis\"},\"description\":\"Guest author Timothy Mathis has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get value from object array in TypeScript?","description":"How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that's increasingly being used for building robust web","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:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/","og_locale":"en_US","og_type":"article","og_title":"How to get value from object array in TypeScript?","og_description":"How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that's increasingly being used for building robust web","og_url":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2024-06-24T04:56:15+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png","type":"image\/png"}],"author":"Timothy Mathis","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Timothy Mathis","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/"},"author":{"name":"Timothy Mathis","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318"},"headline":"How to get value from object array in TypeScript?","datePublished":"2024-06-24T04:56:15+00:00","dateModified":"2024-06-24T04:56:15+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/"},"wordCount":954,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/","url":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/","name":"How to get value from object array in TypeScript?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2024-06-24T04:56:15+00:00","dateModified":"2024-06-24T04:56:15+00:00","description":"How to Get Value from Object Array in TypeScript? TypeScript is an open-source programming language that's increasingly being used for building robust web","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-value-from-object-array-in-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to get value from object array in TypeScript?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318","name":"Timothy Mathis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Timothy Mathis"},"description":"Guest author Timothy Mathis has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/258528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=258528"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/258528\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=258528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=258528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=258528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}