{"id":258948,"date":"2024-05-09T18:27:24","date_gmt":"2024-05-09T18:27:24","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/?p=258948"},"modified":"2024-05-09T18:27:24","modified_gmt":"2024-05-09T18:27:24","slug":"how-to-match-array-value-in-javascript","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/","title":{"rendered":"How to match array value in JavaScript?"},"content":{"rendered":"<p>Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a particular value within an array. In this article, we will explore different approaches to matching array values in JavaScript.<\/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-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#Using_the_includes_Method\" title=\"Using the includes() Method\">Using the includes() Method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#Using_the_indexOf_Method\" title=\"Using the indexOf() Method\">Using the indexOf() Method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#Using_the_find_Method\" title=\"Using the find() Method\">Using the find() Method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#FAQs\" title=\"FAQs:\">FAQs:<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#1_Can_I_use_the_includes_method_with_string_values\" title=\"1. Can I use the includes() method with string values?\">1. Can I use the includes() method with string values?<\/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-match-array-value-in-javascript\/#2_Does_the_includes_method_work_in_all_browsers\" title=\"2. Does the includes() method work in all browsers?\">2. Does the includes() method work in all browsers?<\/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-match-array-value-in-javascript\/#3_How_can_I_check_if_an_array_contains_multiple_values\" title=\"3. How can I check if an array contains multiple values?\">3. How can I check if an array contains multiple values?<\/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-match-array-value-in-javascript\/#4_What_is_the_difference_between_includes_and_indexOf\" title=\"4. What is the difference between includes() and indexOf()?\">4. What is the difference between includes() and indexOf()?<\/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-match-array-value-in-javascript\/#5_Can_I_use_the_find_method_with_an_object\" title=\"5. Can I use the find() method with an object?\">5. Can I use the find() method with 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-match-array-value-in-javascript\/#6_How_can_I_match_a_value_without_considering_its_case\" title=\"6. How can I match a value without considering its case?\">6. How can I match a value without considering its case?<\/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-match-array-value-in-javascript\/#7_What_if_I_want_to_match_based_on_a_custom_condition\" title=\"7. What if I want to match based on a custom condition?\">7. What if I want to match based on a custom condition?<\/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-match-array-value-in-javascript\/#8_How_can_I_match_a_value_in_a_multidimensional_array\" title=\"8. How can I match a value in a multidimensional array?\">8. How can I match a value in a multidimensional array?<\/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-match-array-value-in-javascript\/#9_Does_the_includes_method_work_with_sparse_arrays\" title=\"9. Does the includes() method work with sparse arrays?\">9. Does the includes() method work with sparse arrays?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#10_How_can_I_match_values_in_an_array_of_objects\" title=\"10. How can I match values in an array of objects?\">10. How can I match values in 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-15\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#11_Are_there_any_performance_considerations_when_matching_array_values\" title=\"11. Are there any performance considerations when matching array values?\">11. Are there any performance considerations when matching array values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#12_How_can_I_match_values_in_two_arrays\" title=\"12. How can I match values in two arrays?\">12. How can I match values in two arrays?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Using_the_includes_Method\"><\/span>Using the includes() Method<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <code>includes()<\/code> method is a simple and straightforward way to check if an array contains a specific value. It returns <code>true<\/code> if the value is found and <code>false<\/code> otherwise.<\/p>\n<p><strong>How to match array value in JavaScript?<\/strong><br \/>\nTo match a value in an array, use the <code>includes()<\/code> method as follows:<\/p>\n<p>&#8220;`<br \/>\nconst myArray = [1, 2, 3, 4, 5];<br \/>\nconst valueToMatch = 3;<\/p>\n<p>if (myArray.includes(valueToMatch)) {<br \/>\n  console.log(&#8220;Value matched!&#8221;);<br \/>\n} else {<br \/>\n  console.log(&#8220;Value not found!&#8221;);<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>This code snippet checks if the value 3 exists within the array <code>myArray<\/code> and prints the appropriate message accordingly.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Using_the_indexOf_Method\"><\/span>Using the indexOf() Method<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Similar to the <code>includes()<\/code> method, the <code>indexOf()<\/code> method can be used to find the index of a value within an array. If the value is not found, it returns -1.<\/p>\n<p><strong>How to match array value in JavaScript?<\/strong><br \/>\nTo match a value in an array and retrieve its index, use the <code>indexOf()<\/code> method:<\/p>\n<p>&#8220;`<br \/>\nconst myArray = [1, 2, 3, 4, 5];<br \/>\nconst valueToMatch = 3;<\/p>\n<p>const index = myArray.indexOf(valueToMatch);<\/p>\n<p>if (index > -1) {<br \/>\n  console.log(&#8220;Value found at index&#8221;, index);<br \/>\n} else {<br \/>\n  console.log(&#8220;Value not found!&#8221;);<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>In this example, the <code>indexOf()<\/code> method is used to find the index of the value 3 within the array. If the index is greater than -1, the value is found, and the corresponding message is printed.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Using_the_find_Method\"><\/span>Using the find() Method<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <code>find()<\/code> method provides a more flexible way of matching values in an array. Unlike <code>includes()<\/code> and <code>indexOf()<\/code>, it can return the actual value instead of just a boolean or index.<\/p>\n<p><strong>How to match array value in JavaScript?<\/strong><br \/>\nTo match a value in an array and retrieve the value itself, use the <code>find()<\/code> method:<\/p>\n<p>&#8220;`<br \/>\nconst myArray = [1, 2, 3, 4, 5];<br \/>\nconst foundValue = myArray.find(value => value === 3);<\/p>\n<p>if (foundValue !== undefined) {<br \/>\n  console.log(&#8220;Value matched:&#8221;, foundValue);<br \/>\n} else {<br \/>\n  console.log(&#8220;Value not found!&#8221;);<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>The <code>find()<\/code> method takes a callback function that returns <code>true<\/code> when a matching value is found. If a value is found, it will be assigned to the <code>foundValue<\/code> variable, and the corresponding message will be printed.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_Can_I_use_the_includes_method_with_string_values\"><\/span>1. Can I use the <code>includes()<\/code> method with string values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, the <code>includes()<\/code> method performs a simple equality check and can be used with any data type, including strings.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Does_the_includes_method_work_in_all_browsers\"><\/span>2. Does the <code>includes()<\/code> method work in all browsers?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, the <code>includes()<\/code> method is supported in all modern browsers, including IE11.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_How_can_I_check_if_an_array_contains_multiple_values\"><\/span>3. How can I check if an array contains multiple values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use the <code>every()<\/code> method in combination with the <code>includes()<\/code> method to check if an array contains all the specified values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_What_is_the_difference_between_includes_and_indexOf\"><\/span>4. What is the difference between <code>includes()<\/code> and <code>indexOf()<\/code>?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nThe <code>includes()<\/code> method returns <code>true<\/code> or <code>false<\/code> based on the presence of a value, while <code>indexOf()<\/code> returns the index of the value or -1 if it&#8217;s not found.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Can_I_use_the_find_method_with_an_object\"><\/span>5. Can I use the <code>find()<\/code> method with an object?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, the <code>find()<\/code> method can be used with objects as well. Use the appropriate condition inside the callback function to match the desired object property.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_How_can_I_match_a_value_without_considering_its_case\"><\/span>6. How can I match a value without considering its case?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo perform a case-insensitive match, convert both the array values and the value to match to lowercase (or uppercase) using the <code>toLowerCase()<\/code> (or <code>toUpperCase()<\/code>) method and then use one of the matching techniques mentioned above.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_What_if_I_want_to_match_based_on_a_custom_condition\"><\/span>7. What if I want to match based on a custom condition?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIn that case, you can provide a custom callback function to the <code>find()<\/code> method, where you can implement any complex matching logic required.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_How_can_I_match_a_value_in_a_multidimensional_array\"><\/span>8. How can I match a value in a multidimensional array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo match a value in a multidimensional array, you can use nested loops, iterate over each element of the array, and perform the matching operation.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_Does_the_includes_method_work_with_sparse_arrays\"><\/span>9. Does the <code>includes()<\/code> method work with sparse arrays?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, the <code>includes()<\/code> method can handle sparse arrays, which have sparse or empty elements.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"10_How_can_I_match_values_in_an_array_of_objects\"><\/span>10. How can I match values in an array of objects?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use the <code>find()<\/code> method and compare the desired property of each object.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_Are_there_any_performance_considerations_when_matching_array_values\"><\/span>11. Are there any performance considerations when matching array values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nThe <code>indexOf()<\/code> method tends to be faster than the <code>find()<\/code> method for large arrays, but the performance difference may vary depending on the use case. Consider the size of your array and the specific matching requirements.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"12_How_can_I_match_values_in_two_arrays\"><\/span>12. How can I match values in two arrays?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYou can use one of the matching techniques mentioned above inside a loop to match values in two arrays, comparing each value of one array with the elements of the other.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a particular value within an array. In this article, we will explore different approaches to matching array values in JavaScript. Using the includes() Method The includes() method is a simple &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to match array value in JavaScript?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#more-258948\">Read more<span class=\"screen-reader-text\">How to match array value in JavaScript?<\/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-258948","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 match array value in JavaScript?<\/title>\n<meta name=\"description\" content=\"Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a\" \/>\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-match-array-value-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to match array value in JavaScript?\" \/>\n<meta property=\"og:description\" content=\"Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/\" \/>\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-05-09T18:27:24+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=\"4 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-match-array-value-in-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/\"},\"author\":{\"name\":\"Timothy Mathis\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\"},\"headline\":\"How to match array value in JavaScript?\",\"datePublished\":\"2024-05-09T18:27:24+00:00\",\"dateModified\":\"2024-05-09T18:27:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/\"},\"wordCount\":730,\"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-match-array-value-in-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/\",\"name\":\"How to match array value in JavaScript?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2024-05-09T18:27:24+00:00\",\"dateModified\":\"2024-05-09T18:27:24+00:00\",\"description\":\"Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to match array value in JavaScript?\"}]},{\"@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 match array value in JavaScript?","description":"Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a","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-match-array-value-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How to match array value in JavaScript?","og_description":"Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a","og_url":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2024-05-09T18:27:24+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/"},"author":{"name":"Timothy Mathis","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318"},"headline":"How to match array value in JavaScript?","datePublished":"2024-05-09T18:27:24+00:00","dateModified":"2024-05-09T18:27:24+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/"},"wordCount":730,"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-match-array-value-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/","url":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/","name":"How to match array value in JavaScript?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2024-05-09T18:27:24+00:00","dateModified":"2024-05-09T18:27:24+00:00","description":"Arrays are an essential data structure in JavaScript that allow developers to store multiple values in a single variable. Often, we may need to find a","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-match-array-value-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to match array value in JavaScript?"}]},{"@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\/258948","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=258948"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/258948\/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=258948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=258948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=258948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}