0
JavaScript duels question.
Hello everybody, i've faced an interesting question during one of JS duels. It had loop for...of. for (let {x=2, y=3} of [{x=1},{y=4}]) { arr.push(x,y);} And somehow it pushed 1,2,3,4 to the array(arr). From what i know for...of syntax is 'for (variable of object) {};' And this loop assigns value of each element in object(or anything iterable) to a variable. I've tried to Google it, but didn't find any answers. Could anyone explain this behaviour to me? Thanks a lot in advance.
2 ответов
+ 2
eeh the syntax in that code is throwing errors and is wrong,please retrace the question and provide the correct version