the bot spams the (`You Found ${earnings} Coins!`); and I think it’s collecting it’s own messages (infinite loop) I asked the problem from some of my friends and they said the same: “the bot is collecting it’s own messages, remove the collector”. but I don’t know how can I …
how to search the node value with id from a parent-child json data
I have a parent-child json based data i want to search the end leaf node by searching its _id value, for example I want to find the leaf node whose id is ‘624021f469f627d1d3484b38’, it should output the whole node value whose name is ‘55555555’, I have tried the following methods. but …
React – Can console log object, but not specific property of said object
I’m doing an exercise to learn React in which I have set up a page with a list of clickable pokemon names which are linking to the pokemons specific detail page. Below is the code of the details page This code has an error I fail to understand The console.log(specificPokemon) works fine, but the console…
How to loop through object of strings with dates in typescript?
I have object, keys are dates, before dot are months, after are years: the function takes two dates and return an array with objects containing values from the dataObj How to loop through dataObj? I tried for loop but have no idea what to do with final-expression, how to update counter variable, pass next key…
nested if statements javascript
I’m trying to do a lookup until i found an especific value; currently using if statements like this but right now its only two levels and i dont need how many if statements will be needed until the conditions meets. Is there a way to avoid using infinite IF statements ? Answer You can make use of recurs…
formData in React, getting null when I send formdata to backend Express
When I send data from the frontend I receive null in the backend. I am sending 2 string data URLs and dates so I don’t think that I need to use extra middleware for receiving the values. Frontend: Backend: Answer it’s empty because on the server you have a json parser, but you’re sending a m…
How to read specific object from json file in JavaScript?
I’m trying to work with a json file but I can’t figure out how to read just a specific object from a json file. My current code looks like this: This works fine. However when I try to get some object from the file like this: It doesn’t work because it is a string. So my question is how can
How to pass data from a JSON file to a JavaScript class
I have a local JSON file with the following structure: and a class project, which I’m not sure should be like this: Now, I can work with the data after using fetch, but I do not know how to use it outside of the response. I want to fetch the JSON file and put it into a class I can
React and JS closure issue
Background of the problem I have a simple “Ticker” class that can hold a single callback, and execute that callback each ~1s via setInterval The code is as follows. I have a React Functional Component in a nother file, that instantiates a Ticker Object, at class level(I.E outside the functional co…
date copy stops the loop statement to function as intended
What i am trying to do is to display available rooms which are in data i map the rooms using data.map , check if one is available between a given ( checkin and checkout date ) using availdata[p.roomId][date].i==0 , if not it will display the available room . the code works fine but as soon as it finds an avai…