Skip to content

Tag: node.js

discord.js “TypeError: fn is not a function”

So I started getting this “TypeError: fn is not a function” after I added the if-else statement to the code Thats the code I have and my error is Thank you to anyone that is able to help me find a fix for this. Answer It’s because .some() accepts a callback function only but notverified is a…

How to add new value with same key to document

I need to write down a category and its cost in category object. Now, in my code example, I am adding the products: $50 category to the user. After execution, ‘categories’: { products: ’50$’ } is displayed in the console. But if you add products: 1000$ again, it will overwrite and outp…

Search for multiples Keys on new Map()

Normally what we do is like And when we want to retrieve the information just One of the benefits that Map has is that we can put whatever we want as key or value. I’m trying to set a multiple value of keys on the “key” part of the map, that’s not the problem is later when I want to

continue a for loop outside of a promise

so let’s say I have something like this: I can’t use continue because “jump target cannot cross function boundaries” and need a way around that to continue the for loop when that function that checks X results in true. Thanks so much for any assistance. Answer If you want the for loop …