this is my function to make related state true I need to make index related state true while at the same time states not equal to index need make false, How can I achieve that in the same function above as a example – in current condition, if I expand (index 1), then expand (index 2) my array looks like
Function recursion advice
I am building an employee tracking app. I want my app to work so that after each one of the functions for the various list selections is complete, the app will re-prompt you with the options list again. There are a few methods I can think of to achieve this but I was hoping a more seasoned developer could rec…
Trouble when parsing JSON string
I’m dumping JSON in Django view and then parsing JSON in JS to get the data. My view.py (Django) The ibm variable output in Django template is: My index.html (JS inside) The issue is: I’m having to JSON.parse double times to get the JS object. The variable mydata, despite the JSON.parse, is string…
Keep dark or light mode over different pages with javascript
Basically, I got a dark mode on the front page, with the script being (from W3schools) : And the button : and some CSS just for example : So how can I, with some Javascript, make the mode the user is using stay between pages and not come back to default when accessing another page ? Beginner here, any help
Typescript: How can I extract the value from JSON objects inside an array with changing property names?
I’m new to typescript and would like to extract the value from JSON objects inside an array with changing property names. My (simplified) code is as follows: My goal in this example is to extract “hombre” from the first JSON object in the array. However, I get the following error message: El…
How to put text and get audio discord.js like google translate?
Is there a way or a module on discord.js that allows you to say vocally some text? I would need it to make a kind of voice log, a trivial example would be that when someone connects to a voice channel the bot says “$username has entered the voice channel”. Does anyone know how to do this? I would …
Next.js keeps throwing error params is undefined
I have successfully connected my custom server using Node.js and Express.js with Next.js. I’m trying to fetch a car by its id whenever I click it among other cars, so I can have that particular car only. But I keep getting an error saying params is undefined even though I get the id at the back of my li…
React blank page when I try to import from another component
The react app was working perfectly until I tried to import AlertDialogSlide from confirmation.js component. There are no errors while compiling but I have a blank page. Answer check out your confirmation.js file. Maybe you make some mistake on that. I run this code after commenting confirmation.js file, it&#…
Firebase database. How to append values to array?
I have the following test data My question is how do I correctly append new value to an array without overwriting it? My idea was to retrieve existing data then spread it like so […currentData, “bob”]. Is there a better alternative? Answer There is no atomic operation to add an item to an ar…
JavaScript setAttribute on page after run script
I have a script in HTML: afterload page and script run to give other elements in the console. the code HTML now is: this code <div id=”de6854″> and <iframe id=”4526d” is change ID dynamically. Now I want to change setAttribute src=”https://www.ask.com/wp-content/uploads/…