** Unpractical use cases - Iterators What is an iterator? Array Iterator Objects An Array Iterator is an object, that represents a specific iteration over some specific Array instance object. There is not a named constructor for Array Iterator objects. Instead, Array iterator objects are created by calling certain methods of Array instance objects. ref : cma-262 Instead of trying to understand it, lets just look at a example Here we have an object that contains an array, to use the iterator on the array you can simply do something like To use the iterator to move to the next item in the array you call .next() console.log(theArrayIterator.next()) // x 5 { value: 'all', done: false } { value: 'the', done: false } { value: 'array', done: false } { value: 'values', done: false } { value: undefined, done: true } As you can see, each time you call next, it prints the value of the next item in the array, and once it reaches the end of t...
The list of people , objects and even situations that would be better suited for running South Africa at this point than Jacob Zuma. Starting with the obvious, anyone that can read any number written down on paper. Let’s get it out of the way, you, me, your friend from Knysna, that aunt you only see every second year on some family gathering, and just about everyone else in South Africa, this obviously always excludes that what even is he Julius Malema and ffs dude Nicholis Louw. A dead AA battery. Those blue ice things all our parents have in the back of the freezer. A pencil marking on a very unimportant paper. The waiting time between breaths. The advertisements on youtube if you still don’t use adblock. The letters T and L whenever they meet somewhere in a gently read sentence.. That joke about the guy that walks into a bar and says ouch, well not the guy in the joke specifically , but more the joke itself, I believe that in essence it would rule SA in a more lite...