Skip to content

Category: Questions

mongodb .find elements in an array

I have an array that dynamically holds document id’s, in which I need to query another collcetion in mongo to see if the id’s match. I have this code: however, doing “id”: { $in: array_of_docs_bought } doesn’t iterate through the array, so it returns nothing, but when I do this: …

why do these similiar functions not work?

I have some divs and if i hover them I want an popup to show. I have six divs and six popups to show but not all at once instead only one per one. The first function works fine but then the other do not work how can I move them all to one snippet? Answer okay so actually i

THREE.js collision detection and stop/move again

I have a rounded ground and there is a ball on it. trying to move the ball inside the ground with using smartphone orientation. no problem with that part. the ball is moving and make the ball stop at the edge by using three.js intersectsSphere. but couldn’t manage the move the ball again if the orientat…

JS/TS: Getting access to a value wrapped in a promise?

I have an Object where the key is a stringified object and the value is a Promise that eventually resolves to a font object. I use Promise.all to wait for them all to resolve. After this, I log the object in console and it looks like: I want to enumerate through the object to ensure each postscript name in th…

Write assertion subject to whether key has value

I’m trying to come up with a method that would allow me to create a it block that confirms whether my configuration file has a specific attribute. The object has in it: I would like to have an it block that would confirm whether this value is true and if it isn’t, then it should fail. I have tried…