python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to enact DRY to refrain from repeating code. NO concat please
I have 2 blocks of 'for' code which are very similar with the exception for Object.values(feelings) and Object.values(feelings2) part.
I am trying to create a new 'const allFeelings' that holds the fo...
darrenIam
Votes: 0
Answers: 2
JavaScript: Unable to break out of for of loop
I am working on this simulation (link to example) of a Mars rover represented by a object/class. You are supposed to be able to give it inputs of directions based on the terrain of Mars and get a outp...
Antonio Pavicevac-Ortiz
Votes: 0
Answers: 1
Call a callback function inside for of loop
I'm making a request with a for of loop to delete all the cart elements, but it doesn't work as expected. Loop works for first iteration but API returns an error in the second iteration.
I think it's ...
AssSoonAsPossiblee
Votes: 0
Answers: 1
for...of an iterator without closing it
Is it possible to loop over part of an iterator with for...of without closing the iterator when I break the loop?
Example:
function* numbers(i=0){
while(true) yield i++;
}
let nums=numbers();
...
Blue Nebula
Votes: 0
Answers: 1