Skip to content

Commit bc0e527

Browse files
committed
ES6 Features
1 parent 7d89a25 commit bc0e527

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

es6/es6-features.js

+12
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,15 @@ console.log(title);
128128
console.log(symbol3.toString());
129129

130130
console.log(Symbol('foo') === Symbol('foo'));
131+
132+
133+
// 11. Iterator
134+
135+
/** The iterable protocol allows JavaScript objects to define or customize their iteration behavior. **/
136+
137+
var title = 'ES6';
138+
var iterateIt = title[Symbol.iterator]();
139+
140+
console.log(iterateIt.next().value); //output: E
141+
console.log(iterateIt.next().value); //output: S
142+
console.log(iterateIt.next().value); //output: 6

0 commit comments

Comments
 (0)