Built-in string iterators in JavaScript

Strings also have a built-in iterator. Let's for example loop through the characters of a string:

javascriptfor (let elem of 'abc') {
  console.log(elem); // 'a', 'b', 'c'
}

And now let's expand the string through the spread operator:

javascriptconsole.log([...'abc']); // ['a', 'b', 'c']
Задание 1

Given a string with a number:

javascriptlet str = '12345';

Loop through the digits of this number and find their sum.