Category : iterator

function* print() { yield console.log(“before”); yield console.log(“hello world “); return console.log(“this is second line “); } let o = print(); o.next(); //console.log(“before”); o.next(); // console.log(“hello world “); o.next(); //console.log(“this is second line “) why iterator is accessible when I assign to o ? if I call print().next() solely , it seems that iterator will be ..

Read more

let str = ‘<span class=”my”> <var suv=”inn”>’; let regexp = /<(([a-z]+)s*([^>]*))>/g; let result = str.matchAll(regexp); console.log(result[0]); console.log(result); //It is an iterable object’ console.log(“Array from method”); var a = Array.from(result); console.log(a[0]); console.log(a[1]); console.log(“for loop method”); for (let value of result){ console.log(value); } we can see that when we place the ArrayFrom method first, it logged the ..

Read more

I tried to convert my list of list aggregate response into single list. I tried with js script mediator. but its not support, since i have very big data lists. this is my iterate and aggregate function. <iterate id="iterate-over-users" expression="json-eval($.pages)"> <target sequence="backendcall-seqence" /> </iterate> <aggregate id="iterate-over-users"> <completeCondition> <messageCount min="-1" max="-1" /> </completeCondition> <onComplete expression="json-eval($.rawData)" sequence="out-sequence"> ..

Read more