I have a form which shows an alert with a message when the two password input fields do not match but if they do match it shows a confirmation message before creating the user. The issue im having is that even if my confirmation function returns false which means that in the confirm message i selected cancel,…
Tag: javascript
Uncaught Error: Info(…): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 7 m…
React Redux – Cannot set properties of undefined (setting ‘value’)
I need to find a way to get my data from my redux store into a map function but i end up with the error below My console gives me for this: But this code ends to be undefined Thats why the code below ends to be: Uncaught TypeError: Cannot set properties of undefined (setting ‘value’) Edit Answer I…
To find match element in array json.file and change it [node js]
Good afternoon, I have a script that changes the value of the json file I need the script to find the first number 2 in the array and object numbers and change the unit to 3 and my json And after execution js application the file would become like this Answer You can use the Array#findIndex method to find the
How can I transform a single json object into json array?
My axios api returns a JSON object in the format as follow. but I need to tranform each element in the JSON object into a JSON object of a JSON array into this format below. Answer Use Object.entries() to create an array of key / value pairs then map that to the structure you want The array will be sorted
How can I remove a number of objects in an array?
I have an array like this : I only want two of each of category object in the array and remove the rest If the number of objects of that category is over 2 and get something like this : How can I remove the rest of the objects of a specific category If the number of those objects in
Discord Embed Command Cooldown
im trying to create a cooldown for my status command, because they spam a lot on the server the status command and i want a cooldown like 5m and that send a message like, “you need to wait 5m more to use this command im really newbie to javascript, so if anyone can help me Here its my entire command:
Why exercism.org doesn’t accept my solution JS?
I just started with exercism and doing Javascript exercise 2, Lucian’s Luscious Lasagna. I wrote all the code on my VSCode and it all worked fine. but when I insert it in the editor on exercise, it shows errors and doesn’t accept it. It is also showing some things I haven’t seen like ‘…
Get buffer from post body in Expressjs
I am making an express application that handles post data. Because the request body could be any content type and/or binary, I would like req.body to be a Buffer. So what should I use to get a Buffer that represents the request body? Here is my code: Answer body-parser can help achieve this, code example woul…
FirebaseError: Missing or insufficient permissions. with getDocs()
I tried reading the first couple of answers but none seem to have the same rule with the one I currently have my hands on. When I try to call the getDocs() function (using react) I seem to be getting the error FirebaseError: Missing or insufficient permissions. what can I do to not get this error? Below is th…