Posts by Ygor Silva • 36 points
6 posts
-
0
votes1
answer173
viewsA: Search username in a Query of the Mongoose-paginate
You can instantiate an object of the Regexp class to be able to concatenate strings within it. Something like: const searchRegex = new RegExp('^' + search). Then just use the constant searchRegex…
-
1
votes1
answer42
viewsA: Promises giving trouble
I circled here and it worked perfectly. You are using some browser console, correct? As you are using console.warn in case Promise is rejected, it may be that nothing is showing up for you because…
javascriptanswered Ygor Silva 36 -
0
votes3
answers77
viewsA: Function Returning Another Function
An easy way would be to keep the variable res.textContent with its content in the function reset. That way, only the calc will be reset and when the function result is called again the appropriate…
javascriptanswered Ygor Silva 36 -
0
votes2
answers86
viewsA: "Child already has a Parent, it must be Removed first" when sending new object to Reducer
Maybe the problem is that when copying objects, you are not creating new objects, but creating a new array with references to the same objects that were in the old array users. Try to use something…
-
1
votes1
answer298
viewsA: How to return the value of a query to the database in another javascript file?
Cannot assign values to variable exports asynchronously, which is what you’re trying to do. You need the value you want to export to be obtained synchronously. As most of the operations done in a db…
-
-1
votes2
answers84
viewsA: How do I create a time interval in the execution of a for?
You can replace your for a setInterval if the range is always the same size, your code would be: setTimeout(function Linha1() { let i = 0 let interval = setInterval(function () { if (i > 3)…