Skip to content

Category: Questions

.find() returns undefined using JSON data, using node.js

I’m creating a server using node and want to output JSON data, when a specific ID is clicked. I’ve set up a dynamic URL which will pull the data from the clicked video using params and then compare it with the one from the JSON data, using .find() When I log out the “req.params.id” I g…

Get Min date and Max date from Object

How can I find out the min and the max date from an object? Currently, I am getting an array like this: min date should be ‘2010-02-24’ and max date should be ‘2022-10-04’. Is there any built-in function to do this? Thanks in advance. Answer A sort will do the job here, by packing all …

Get channels of category discord v14

i’m trying to get all channels and delete these channels of category in discord v14, but throw me an error: client.channels.cache.get(…).children.forEach is not a function Answer CategoryChannel.children is type CategoryChannelChildManager, which doesn’t have a forEach method, so you can&#82…

Json file data to Chart.JS

I’m trying to add multiple datasets from a json file to a linechart in chart.JS. Here’s my JS code: Here’s my HTML: All other neccessary HTML code is added to make the file valid. There is something wrong with this code i just can’t figure out, I’m able to use the charts to input…

Push to array and convert to string

I need to pass a value as a string and not an array from inside an event listener to a global variable. Currently when the page loads, I check for a cookie inside the event listener and pass that value (‘de’, ‘es’, ‘en’ etc) to an empty array. I don’t know a better wa…

React: multiple sliders sharing a common state

I have two sliders, each with an event listener. Using your mouse to adjust one slider should update a shared state, which should then cause a change in the second slider. However, I only want the event listener for the first slider to fire. In the code I have below, the second slider’s event listener i…