I have some javascript where I’m trying to create a promotion within each of my promotion items. Right now though, for some reason it keeps on nesting itself indefinitely, and I only need it to contain one reference (see screenshot) I’ve tried adding a check to see if promotion.promotion already e…
Category: Questions
generate one of the mutiple possibles anagrams of a string
I’m kind of new to JavaSCript and I want to ask wow can I make a random anagram generator, without a list of all possible anagrams (because that’s not optimized) Example: input: “abc” output: get the input, split it ([“a”, “b”, “c”]), randomize the s…
Why I cannot remove the element of the array of useState hook
This is the code, Please check the function deleting in the filter section I am trying to delete the elemt from the array using setarray. This is the codesandbox link https://codesandbox.io/s/silly-neumann-b0foos?file=/src/App.js:0-1072 Answer e is an object having index as prop… so its e.index
Vue JS – Using URLSearchParams is showing me error
I have an object and I need to pass it to the ajax request. Here thissearchString is an array of object. I need to pass this array of object to the URL. So, I am using URLSearchParams but got this error message: Answer I think you not understand the function of URLSearchParams. Here, what this function do: Wi…
Divide array to group indexes
I have a problem with the following logic in Javascript. I have the following array, that have dynamic number of indexes, in this example I write one array with 2 indexes. [[S,Blue],[M,Red],[L,Yellow] I want to have this structure: { 0: [S,M,L], 1: [Blue,Red,Yellow] } The numbers are the indexes of first grou…
Dynamically change ChartJS Line Chart using Jquery
I’m receiving 3 arrays from server as a response and I’m trying to create a line chart using ChartJS. The line chart turns out to be fine when I feed in the static values but it doesn’t reflect the changes when new data is passed from the server. The arrays after being populated by server re…
Nest JS Table is not creating. Written entities
Team, I have followed Nest.js and TypeORM documentations. Somehow tables are not generating in PostgreSQL. The database is connected successfully. Nest Server running without error. Issue: The table is not generating. src/tag/tag.entity.ts src/app.module.ts .local.env Please help me generate Postgres tables. …
How do I get a specific elements value that has no unique identifiers with Cheerio
I’m trying to get a specific elements value with Cheerio however I’m unsure how. I’ve looked over the documentation and so far, no dice. Website example of the value I’m trying to get, specifically the <dd> that holds the number value of player count. scrape_test is just ensuring…
NextJs doesn’t rerun scripts
When I use the <Link> tag in NextJs to navigate between pages it doesn’t rerun my scripts after changing pages. It only runs the scripts after the first page load or when I press reload. When using plain <a> tags instead, it works fine because the page reloads after each navigation. As far a…
Should I use router.isReady when fetching with react-query?
Been stuck on this issue for some time now trying to retro fit react-query in to my codebase. I have a working version using getStaticProps. I have been experimenting with router.isReady from next/router to try and force the page to wait for the router.query value to be present before passing it as props to t…