JavaScript Symbol iterator Property Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report It is an object of Iterables which is also a kind of generalized arrays. Iterables that make any object easier to use in a for..of the loop. We know that arrays are iterative in nature but other than that, there are also several objects which are used for the iterative purpose. Suppose if any object which is not an array but does possess a group of the list, set, etc then for..of can be used to iterate it. We use for..of loop to represent a range object of any interval. It decides the range in which the for..of the loop will work and iterate the loop. We will use a method Symbol.iterator (an in-built method in JavaScript) to iterate the range object which is mentioned above. The steps in which this method works: Once for..of loop starts it checks the error first, if it is not found then it accesses the method and the object with the method.After that for..of loop will run over the object.To take the next upcoming value, it calls the next() method for that output object.The values returned will be of the form {done: Boolean, value: any}. When done=true is returned then the loop will be considered as the complete one. Syntax: [Symbol.iterator]Features:The range will not have the next() method on its own.When we call to the range[Symbol.iterator](), an iterator is formed and the method next() will generate the value for further iterations. Example: JavaScript let range = { from: 2, to: 7 }; range[Symbol.iterator] = function() { return { now: this.from, end: this.to, next() { if (this.now <= this.end) { return { done: false, value: this.now++ }; } else { return { done: true }; } } }; }; for (let i of range) { console.log(i); } Output: 2 3 4 5 6 7 Supported Browsers: The browsers supported by Symbol iterator property are listed below: Google Chrome 51Firefox 50Edge 15OperaApple Safari We have a complete list of Javascript symbols' properties and methods, to check those please go through the Javascript Symbol Complete Reference article. Create Quiz Comment K krishnakripa Follow 0 Improve K krishnakripa Follow 0 Improve Article Tags : JavaScript Web Technologies JavaScript-Properties JavaScript-Symbol Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)8 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like