ignore all the commented out console logs, anyways, i tried setting both to a variable, i tried doing it by straight comparing this.username to the one in database. its getting the username from the database correctly, ive console logged it and it worked fine, outputted all the usernames from database. howeve…
How to useFetch with a for loop?
I am creating an application with react. I have to fetch several data. This is my fetch statement: At the end of the line, it is a 6 but I have this kind of problem. I have periods and these periods are changed for every object. I call the period from there and I find the length of periods like
Cannot POST / error when trying to create a checkout session with Stripe + React + Express
I am using Stripe’s pre-built checkout method to order and pay for products on my Reactjs app. I recently developed a basic shopping cart and now I am trying to create a “Go To Checkout” input form that would allow the user to send the products in the cart to my express server POST route whe…
Return object using classnames and switch statement
So I have an object build out that has a bunch of methods inside, I want to be able to narrow down some methods and see if there are other ways to do thing, so I will go into more description below: So I have the following method which returns me a bunch of class names: Now I have another
Node.js Canvas image overlapping issue / canvas is creating image on top of previous image
I’m having an issue with Canvas when trying to create a generated collection of .png images. I can create the .png files fine but the first image or the image before is not being cleared. index.js config.js The code is working fine and I’m able to create 10 .png files. From the images above you ca…
How to check if content of an html element is empty?
I was building a simple PHP login form that contains both required fields and validation. regardless required fields, I want to display an error message for each input element that had not been filled. But I come across a problem on the way. The span element I use for styling does not disappear when there is …
JavaScript: Rebuild Array of Objects using Reduce
I have an array of objects that I’m trying to rebuild without any success: I have the below code which produces the following undesired result: I am stuck on trying to convert options to an Array of Objects with value and label as properties. Also im struggling trying to reword TemplateCategory property…
Clicking images to pass the names in a URL string
I have a low level knowledge of javascript and am trying to create a basic image based quiz that passes data back to a search page for local businesses. Each image would have it’s own “tag” as the image ID that relates to one of the options in the search. Ie. Outdoor, Ballroom, Barn, Garden,…
Puppeteer can’t find elements when Headless TRUE
I’m facing some problems with Puppeteer, I want to extract a list of items and succeed when headless is FALSE but not when TRUE. First thing first, I want to get those elements before mapping on it. Here’s my script, maybe you can reproduce it, it is really basic. Answer For starters, I’d pr…
Typescript : How to group an object of named list of objects by field name
I have to manipulate data in this wonderful language which is javascript. Until there I managed to achieve what I needed on my own but I reached my limits there. It’s quite hard to explain how my data is structured so let’s make a schema. This is what I have : What I try to achieve is for each obj…