Question #113

Author: admin
tags: JavaScript  
const str = 'abc';

for (const x of str) {
  console.log(x);
}
What will be printed to the console?
'a'
'abc'
'a', 'b', 'c'
Nothing, there will be an error
Strings are iterable because of String.prototype[Symbol.iterator] method.
const iterator = String.prototype[Symbol.iterator].call('abc');
console.log(iterator.next()); // { value: 'a', done: false }
Rate the difficulty of the question:
easyhard