I want to access to these array location attributes and How to pass loaction to the setstate and display them inside the return state (react functional component used) Answer since response.data.exsitingSupplierDetails is an Array of length = 1, you can access the location like this: response.data.exsitingSup…
Category: Questions
How to use the Pagination in Microsoft Graph API
I would like to be able to retrieve all users in my Azure Active Directory and cache it so I could filter my users on demande. I know about the nextLink used for Pagination. I’m fairly new in the React world and Javascript so I need some help understanding how to cycle through all pages to get all my us…
JavaScript regex get + – * / after a number
Hey I want to make a simple calculator. The calculator should do negatives and so I want to split my input string where I match a “+ – * /” Input is for example “5+-3” so I want to match only the “+” because the “-” is part of my second number “-3…
Google Tag Manager returning undefined on dataLayer variable
I’m trying to create a dataLayer variable so I can push the product name into the event label. The dataLayer push when a user adds a product to cart is: I’ve tried to create a dataLayer variable with the following This is returning undefined in preview mode when I do test add to carts. Where am I …
How to randomly position (shuffle) multiple divs inside container div with button click – javascript
I’m trying to shuffle (on button click) multiple cards that are in the same container, using only javascript. They basically need to change position every time I click the button. My idea was to make a function that would on click set their position to absolute, with top and left 0,so they would all ove…
API image popup finding the correct src path
I have an API image gallery using Unsplash [https://codepen.io/aaron_1986/pen/WNybEmZ]; when I click to enlarge an image – the path of the src is missing. Moreover, I cannot understand how to enter the correct src path to enlarge the image. Answer So basically your issue is the following: Whenever you c…
Another way of implementing an If else statement for viewport check?
I am dealing with a simple premise that questions viewport and based on that i am returning different aspectRatios. Now, for some reason i always have else return as true and then millisecond later the viewport gets validated. The result is that i am picking 2 aspect ratios and that makes me download addition…
“TypeError: db._checkNotDeleted is not a function” when creating a db Ref on Firebase
I’m working on a web app in html (and vanilla JS) that uses firebase for checking and updating values on a Realtime Database, I keep getting a lot of errors but still can’t figure out what I’m getting wrong. I’m sorry I’m new to JS and firebase. Relevant html code (table inside f…
How can i create a directory using Node.js?
how can i write the name and the path of my directory that i will to create in the same node command, like this and remove the path in my script > node ./stack/create.js ./path/folderName i´m trying to create a directory with this script but i want to remove const path in my script and set the path and nam…
Log to console only when run from cli command
I’m currently developing a node js cli tool to do some random stuff for work. Up until this point, my whole app was designed as a cli without any intention to use its functionality somewhere else. Now some of my collegues like to work with a ui instead of a cli so I decited to build a vue web app