Based on this question : Question, I tried to create a flower of life. So far I got the 7 first petals but to create the rest of the flower (19 petals) I’m stuck because I can’t figure out what I’m doing wrong. I’m not so good in Maths and don’t exactly understand how to proceed.…
Tag: javascript
Typescript custom type
If I have an interface in typescript like so How can I factor out my type for text with the pipes so I can use it multiple times as a type in my program? It seems like it should be simple but I’m not sure what the syntax is For clarity I would like to be able to use it
Custom slider in react, Swiping images effecting all product images when next arrow btn pressed
I created function to swipe selected product image inside slide with left and right arrow btns. but when clicked it is swiping every item image not single one. i could not use newSlideArray variable outside of the function. can anyone explain me how to swipe single item image in slide ? Here is my source code…
React-select library crashing my page on render
I am currently attempting to implement react-select into a web-app I am developing, but whenever it is rendered it crashes the entire react application with minified error #130 – Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: …
how can i make all if statements in a loop ? in Javascript
i’ve already tried a for loop but I’m new to javascript so it’s all still hard for me. I am grateful for any help. It should increase values. here´s my code: and so forth. Answer
Convert a string to an object and call a function
I want to store an object as a string, and then convert ot back to an object and call a method of this object. Answer If JSON.parse and JSON.stringify would allow a copy of methods, your code would be insecure and would have risks of people running arbitrary code on your server/computer since normally JSON st…
Javascript: Object.keys(myarray).forEach vs myarray.forEach((obj) => {
Is there an alternative way of looping through my array of objects? it seems the engine version on the application im using is old and doesnt support myArray.forEach((obj) => { but this works on an single object array I think. Object.keys(myArray).forEach( {“jurisdiction”:”SCPB – LO…
Adding Scatter Dots to Horizontal Stacked Bar Chart.js
I have the following horizontal stacked bar chart. However, I am trying to add pink scatter dots onto the chart (based on the right y axis numbers), but they aren’t showing up. Can anyone advise what I am doing wrong please? It seems if i change the chart to normal bar, and not horizontal, the dots show…
Uncaught TypeError: Cannot destructure property when using React context
Hello guys so i tried to make global state so the other page can use the state. The problem is i got an error that says: Im doing this because i want the email from user after logged in and pass them to another page so that i can display the logged in user. App.js: Login.js Answer EmailUser context works
Regex not working on email domain selection properly
Can anyone tell me what is the mistake, my .com example is not working properly Answer You need A grouping construct instead of character classes A regex literal notation so that you do not have to double escape special chars The ^ anchor at the start of the pattern since you need both ^ and $ to make the pat…