Consider: I know the spread syntax. I searched about set, and I didn’t find an explanation about how it works. How can I set comparison of items and find similar items? If set, use a loop in the comparison. Answer Set can only contain unique values; here is what constitutes an equal value according to M…
Tag: javascript
How can I change “created using create-react-app” in search results?
I am trying to post the link to my portfolio onto linkedin and it always shows up with “Web site created using react app” as the description, which definitely doesn’t make it look professional. It is deployed on my domain but is there any way I can get rid of all the create-react-app default…
Using Javascript FileReader in forEach loop to append elements
I am using the FileReader to insert HTML to a preview element. That parts works. However I need to manipulate the elements after they are inserted. When I try to select the inserted elements with (let previews = document.querySelectorAll(‘.fb-preview li’);) I get and empty node array. I was under …
How do I stop state element being passed to child component before it is set?
I’m writing a weather forecast app with React. I’m fetching the data from openweathermap.org API. But to use that I need to know user’s location. So I use other API’s in sequence as well to identify user IP, location, and then weather data according to that location. At each fetching s…
nextjs api not working when fetching through isomorphic-unfetch
Im not getting my data (notes) inside the props, it is giving undefined when im using console.log(notes). My backend api is also in the same project in /pages/api/notes/index.js The api which im calling is ‘http://localhost:3000/api/notes’ Even my api is working fine when im testing it on postman.…
Some of the Express public files are not accessible on localhost
When I run my Node.js app on localhost, I can access for example http://localhost:3000/css/dashboard.css However, if I put a logo.png to the same directory and try http://localhost:3000/css/logo.png on my browser, I only get “Cannot GET /css/logo.png”. I tried with several browsers. In my app, the…
Is there a way to not reload the whole html body with React Routers?
My React project’s App.js file has routes like so: In my Navbarr component, I have Links that set the routes, e.g.: When I click on any of the links, I would like it to just change the component in my <Switch>. Instead, it seems to re-load the whole html body (my background component flashes, even…
Why am I getting this UNEXPECTED HTTP error in NodeJS
So guys i’m setting up my backend in NodeJS for an e-commerce website. But I ran into an error trying to implement the “Order” method. First the connection to mysql database : Then in my Models there is a Client class that contains the following method : The orderData parameter in the order(…
how to fix Uncaught SyntaxError: Identifier ‘translate’ has already been declared
i can’t find solution for this bug i wrok on site web multi language but i can’t don’t know how to fix this bug code Html and link i need to change and this code language Answer This variable has probably already been declared. Check this js file and the others the page references. If there …
How to play animation only when the element is on screen
I’m working in React, and I need to know when an element is on screen to play a fade animation, and make it appear on screen. Because the animation always plays when the page is loaded, but if you have to scroll to see the element, then you’ll never see the animation 🙁 In my CSS file I have: What…