I’m having trouble trying to check a string for words from an array and if it includes the word replace them. var blocked = [ “inappropriate word one”, “inappropriate word two”, ]; var …
Category: Questions
How to create schema customization to use optional field “featureImage” from gatsby blog
I’m making a Gatsby blog as a side project. I want to use the “featureImage” optional field in mdx frontmatter. I tried to refer to the https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization#creating-type-definitions document according to the error message, but it wa…
Javascript get the max value grouped by another attribute
Hello I have an array that looks like this I wanted to get the maximum score for each “zs_numero” and then multiply all the maximum scores with the coefficient to get a final result So i want to get the values like this: and then make a a variable that calculate all the (zs_coefficient*zs_score) a…
React Firebase deleting the wrong document id
I’ve been trying to make a delete operation on a firebase database using Reactjs. I’ve got a bug with my function grabbing the wrong id from firebase. I have a button that calls a handleOpen function which opens a Modal. Modal operations: I’ve got a button that calls a handleDelete function …
Cloudinary configuration is not read data from .env file
I’m using Cloudinary with my node.js project… The issue is cloudinary.config is not reading data from .env file, I have to type them directly! I’ll be thankful if anyone can help 🙏🏻 Answer Issue is solved with adding require(“dotenv”).config(); to the beginning of the same file w…
How to announce new content after ‘Show more’ button is clicked?
I have been trying to add VO support in an area that loads some additional content after user clicks Show more button (refer the screenshots attached). Required behavior: I need the VO to announce the info about additionally loaded elements, something like “What is a cookie? and 11 more items”. Tr…
Use Svelte with Stencil components
we want to build an application with svelte but are stuck at using our components that we built with stenciljs. At first it looked like it worked like a charm but as stencil components use the term “slot” and svelte does too, i am reveiving an error when using this component on svelte Element with…
Stuck on extracting information from an array in javascript
I have been able to create the array and average but I am running into roadblocks extracting information from the array. I need to: Loop and find students that failed. Find the student with the highest mark I was trying to add code as below to extract – but it crashes on me. Any assistance would be grea…
How do I split an array of objects into multiple arrays of objects while filtering for duplicates?
Ok, tall order I know. So here’s my situation, say I have the array of objects below I would like for this to be changed to [{name: bar1, label: bar1}, {name: bar4, label: bar4},{name: bar7, label: bar7}] [{name: bar2, label: bar2}, {name: bar5, label: bar5},{name: bar8, label: bar8}] [{name: bar3, labe…
Time Space Complexity of k smallest of unsorted array
I solved this problem given to me in an interview, but I do not know what the Time Space complexity is. What is the Time Space complexity of the following solution? I think it might be O(log(n)) or is it simple O(n)? Answer Your solution uses a characteristic of JavaScript objects: keys that are decimal repre…