{"id":3616,"date":"2025-11-03T08:15:21","date_gmt":"2025-11-03T08:15:21","guid":{"rendered":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/"},"modified":"2025-11-03T08:15:21","modified_gmt":"2025-11-03T08:15:21","slug":"javascript-for-everyone-iterators-3","status":"publish","type":"post","link":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/","title":{"rendered":"JavaScript For Everyone: Iterators"},"content":{"rendered":"<article>\n<h2>Introduction to Iterators in JavaScript<\/h2>\n<p>JavaScript has become an essential language for web development, and one of its powerful features is the ability to handle data collections through iterators. Whether you are a novice or an experienced developer, understanding iterators will enhance your coding skills and enable you to write cleaner, more efficient code.<\/p>\n<h2>What are Iterators?<\/h2>\n<p>In JavaScript, an iterator is an object that defines a sequence and potentially a return value upon its completion. An iterator provides a way to access elements of a collection (like arrays, strings, or maps) one at a time without exposing the underlying structure of the collection.<\/p>\n<h2>How Iterators Work<\/h2>\n<p>The iterator protocol consists of a method that returns an object with a <code>next()<\/code> method. This <code>next()<\/code> method returns an object that contains two properties:<\/p>\n<ul>\n<li><strong>value<\/strong>: The current element value.<\/li>\n<li><strong>done<\/strong>: A boolean indicating whether the iteration is complete.<\/li>\n<\/ul>\n<h3>Creating a Simple Iterator<\/h3>\n<p>Here\u2019s how you can create a basic iterator using a JavaScript object:<\/p>\n<pre><code>const myIterator = {\n    index: 0,\n    values: ['apple', 'banana', 'cherry'],\n    next: function() {\n        if (this.index &lt; this.values.length) {\n            return { value: this.values[this.index++], done: false };\n        } else {\n            return { done: true };\n        }\n    }\n};<\/code><\/pre>\n<h3>Using the Iterator<\/h3>\n<p>To utilize the iterator, you can call the <code>next()<\/code> method:<\/p>\n<pre><code>let result = myIterator.next();\nwhile (!result.done) {\n    console.log(result.value);\n    result = myIterator.next();\n}<\/code><\/pre>\n<h2>Built-in Iterators in JavaScript<\/h2>\n<p>JavaScript provides built-in iterators for various data structures such as Arrays, Maps, Sets, and Strings. Below are examples for each:<\/p>\n<h3>Array Iterator<\/h3>\n<p>Every array in JavaScript has a built-in iterator:<\/p>\n<pre><code>const arr = [1, 2, 3];\nconst arrIterator = arr.values();\nconsole.log(arrIterator.next().value); \/\/ 1<\/code><\/pre>\n<h3>Map Iterator<\/h3>\n<p>Maps also support iteration:<\/p>\n<pre><code>const map = new Map();\nmap.set('a', 1);\nmap.set('b', 2);\nconst mapIterator = map.entries();\nconsole.log(mapIterator.next().value); \/\/ ['a', 1]<\/code><\/pre>\n<h3>Set Iterator<\/h3>\n<p>Similar to Maps, Sets have their own iterator:<\/p>\n<pre><code>const set = new Set([1, 2, 3]);\nconst setIterator = set.values();\nconsole.log(setIterator.next().value); \/\/ 1<\/code><\/pre>\n<h3>String Iterator<\/h3>\n<p>Strings can also be iterated over:<\/p>\n<pre><code>const str = 'hello';\nconst strIterator = str[Symbol.iterator]();\nconsole.log(strIterator.next().value); \/\/ 'h'<\/code><\/pre>\n<h2>Creating Custom Iterable Objects<\/h2>\n<p>You can create your own iterable objects by implementing the <code>Symbol.iterator<\/code> method:<\/p>\n<pre><code>const customIterable = {\n    items: ['a', 'b', 'c'],\n    [Symbol.iterator]: function() {\n        let index = 0;\n        return {\n            next: () => {\n                if (index &lt; this.items.length) {\n                    return { value: this.items[index++], done: false };\n                } else {\n                    return { done: true };\n                }\n            }\n        };\n    }\n};<\/code><\/pre>\n<h3>Using the Custom Iterable<\/h3>\n<p>You can use a for&#8230;of loop to iterate over your custom iterable:<\/p>\n<pre><code>for (const item of customIterable) {\n    console.log(item);\n}<\/code><\/pre>\n<h2>Common Use Cases<\/h2>\n<p>Iterators are particularly useful in various scenarios:<\/p>\n<ul>\n<li>Iterating over collections without exposing their structure.<\/li>\n<li>Implementing custom data structures.<\/li>\n<li>Enhancing performance for large data sets.<\/li>\n<\/ul>\n<h2>FAQs<\/h2>\n<h3>What is the difference between an iterator and an array method?<\/h3>\n<p>An iterator accesses elements one at a time, while array methods like <code>map<\/code> or <code>filter<\/code> can process all elements at once and return a new array.<\/p>\n<h3>Can I use iterators with async functions?<\/h3>\n<p>Yes, JavaScript also has async iterators for handling asynchronous data streams.<\/p>\n<h3>How can I optimize my code with iterators?<\/h3>\n<p>Using iterators can help manage memory usage and improve performance when dealing with large datasets.<\/p>\n<h2>Conclusion<\/h2>\n<p>JavaScript iterators provide a powerful way to traverse data collections while maintaining a clean and understandable code structure. By mastering iterators, you can enhance your coding practices, making your applications more efficient and adaptable. For more tools to optimize your JavaScript development, check out our <a href=\"https:\/\/webtoolslab.io\/\">WebToolsLab (All Tools)<\/a>, including our <a href=\"https:\/\/webtoolslab.io\/tools\/js-minifier.php\">JS Minifier<\/a> and <a href=\"https:\/\/webtoolslab.io\/tools\/json-formatter.php\">JSON Formatter<\/a>.<\/p>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>Learn about JavaScript iterators, their types, and how to use them effectively in your code.<\/p>\n","protected":false},"author":1,"featured_media":2866,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-3616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript For Everyone: Iterators - WebToolsLab<\/title>\n<meta name=\"description\" content=\"Learn about JavaScript iterators, their types, and how to use them effectively in your code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript For Everyone: Iterators - WebToolsLab\" \/>\n<meta property=\"og:description\" content=\"Learn about JavaScript iterators, their types, and how to use them effectively in your code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/\" \/>\n<meta property=\"og:site_name\" content=\"WebToolsLab\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-03T08:15:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1820\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"maashraf\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"maashraf\" \/>\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\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/\"},\"author\":{\"name\":\"maashraf\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/#\\\/schema\\\/person\\\/dc734a267c9220810951a2c42f320fbb\"},\"headline\":\"JavaScript For Everyone: Iterators\",\"datePublished\":\"2025-11-03T08:15:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/\"},\"wordCount\":427,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/#\\\/schema\\\/person\\\/dc734a267c9220810951a2c42f320fbb\"},\"image\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/1752245927123.webp\",\"articleSection\":[\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/\",\"url\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/\",\"name\":\"JavaScript For Everyone: Iterators - WebToolsLab\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/1752245927123.webp\",\"datePublished\":\"2025-11-03T08:15:21+00:00\",\"description\":\"Learn about JavaScript iterators, their types, and how to use them effectively in your code.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#primaryimage\",\"url\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/1752245927123.webp\",\"contentUrl\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/1752245927123.webp\",\"width\":1820,\"height\":1024,\"caption\":\"1752245927123\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/javascript-for-everyone-iterators-3\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript For Everyone: Iterators\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/\",\"name\":\"WebToolsLab Free Online Developer Tools\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/#\\\/schema\\\/person\\\/dc734a267c9220810951a2c42f320fbb\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/#\\\/schema\\\/person\\\/dc734a267c9220810951a2c42f320fbb\",\"name\":\"maashraf\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/favicon-1.png\",\"url\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/favicon-1.png\",\"contentUrl\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/favicon-1.png\",\"width\":96,\"height\":96,\"caption\":\"maashraf\"},\"logo\":{\"@id\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/favicon-1.png\"},\"sameAs\":[\"https:\\\/\\\/webtoolslab.io\\\/blog\"],\"url\":\"https:\\\/\\\/webtoolslab.io\\\/blog\\\/author\\\/maashraf\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript For Everyone: Iterators - WebToolsLab","description":"Learn about JavaScript iterators, their types, and how to use them effectively in your code.","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:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript For Everyone: Iterators - WebToolsLab","og_description":"Learn about JavaScript iterators, their types, and how to use them effectively in your code.","og_url":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/","og_site_name":"WebToolsLab","article_published_time":"2025-11-03T08:15:21+00:00","og_image":[{"width":1820,"height":1024,"url":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp","type":"image\/webp"}],"author":"maashraf","twitter_card":"summary_large_image","twitter_misc":{"Written by":"maashraf","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#article","isPartOf":{"@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/"},"author":{"name":"maashraf","@id":"https:\/\/webtoolslab.io\/blog\/#\/schema\/person\/dc734a267c9220810951a2c42f320fbb"},"headline":"JavaScript For Everyone: Iterators","datePublished":"2025-11-03T08:15:21+00:00","mainEntityOfPage":{"@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/"},"wordCount":427,"commentCount":0,"publisher":{"@id":"https:\/\/webtoolslab.io\/blog\/#\/schema\/person\/dc734a267c9220810951a2c42f320fbb"},"image":{"@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#primaryimage"},"thumbnailUrl":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp","articleSection":["Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/","url":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/","name":"JavaScript For Everyone: Iterators - WebToolsLab","isPartOf":{"@id":"https:\/\/webtoolslab.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#primaryimage"},"image":{"@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#primaryimage"},"thumbnailUrl":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp","datePublished":"2025-11-03T08:15:21+00:00","description":"Learn about JavaScript iterators, their types, and how to use them effectively in your code.","breadcrumb":{"@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#primaryimage","url":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp","contentUrl":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp","width":1820,"height":1024,"caption":"1752245927123"},{"@type":"BreadcrumbList","@id":"https:\/\/webtoolslab.io\/blog\/javascript-for-everyone-iterators-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webtoolslab.io\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript For Everyone: Iterators"}]},{"@type":"WebSite","@id":"https:\/\/webtoolslab.io\/blog\/#website","url":"https:\/\/webtoolslab.io\/blog\/","name":"WebToolsLab Free Online Developer Tools","description":"","publisher":{"@id":"https:\/\/webtoolslab.io\/blog\/#\/schema\/person\/dc734a267c9220810951a2c42f320fbb"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webtoolslab.io\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/webtoolslab.io\/blog\/#\/schema\/person\/dc734a267c9220810951a2c42f320fbb","name":"maashraf","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/favicon-1.png","url":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/favicon-1.png","contentUrl":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/favicon-1.png","width":96,"height":96,"caption":"maashraf"},"logo":{"@id":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/favicon-1.png"},"sameAs":["https:\/\/webtoolslab.io\/blog"],"url":"https:\/\/webtoolslab.io\/blog\/author\/maashraf\/"}]}},"jetpack_featured_media_url":"https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp","uagb_featured_image_src":{"full":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp",1820,1024,false],"thumbnail":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123-150x150.webp",150,150,true],"medium":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123-300x169.webp",300,169,true],"medium_large":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123-768x432.webp",768,432,true],"large":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123-1024x576.webp",1024,576,true],"1536x1536":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123-1536x864.webp",1536,864,true],"2048x2048":["https:\/\/webtoolslab.io\/blog\/wp-content\/uploads\/2025\/07\/1752245927123.webp",1820,1024,false]},"uagb_author_info":{"display_name":"maashraf","author_link":"https:\/\/webtoolslab.io\/blog\/author\/maashraf\/"},"uagb_comment_info":0,"uagb_excerpt":"Learn about JavaScript iterators, their types, and how to use them effectively in your code.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/posts\/3616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/comments?post=3616"}],"version-history":[{"count":0,"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/posts\/3616\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/media\/2866"}],"wp:attachment":[{"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/media?parent=3616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/categories?post=3616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webtoolslab.io\/blog\/wp-json\/wp\/v2\/tags?post=3616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}