I have a nested JSON objects that looks like {“name”, “children”: [JSON objects]}. I am trying to add a new child to the object found with a variable path, an array of names. My code doesn’t work in my React Native app, however it does in the Chrome console, which makes me really…
Pass selected index of object that resides outside of a v-for loop in Vue 3
I’m creating a simple shopping cart in Vue 3 for learning purposes. So far, I’ve set up everything from the products object to the addToCart() functionality, and everything works within a v-for loop. The problem is I need to display the product’s title within an alert that resides outside th…
Unbind event in Javascript
I’m just getting started with A/B test using Dynamic Yield. I’m facing a few issues overwriting events that are fired by Javascript. Let’s for the sake of this example take this function written in the frontend: Now my question is, how can I overwrite this event on after the whole file is al…
Programatically generating Gatsby pages without a slug from Graphql
I have set up an ACF options page in WordPress called Projects Inside the Projects options page there is an ACF repeater allowing the user to add multiple Projects. In Gatsby, I’m using Graphql to query the data for my Projects in two files: Inside a custom hook, allowing access to the data globally in my Gat…
How to do an If await by the async function response
I’m trying to create a function that checks if a table already exists in the database and if it doesn’t, create one But the problem is the If doesn’t await for checkTableExist() Console Log Answer In checkTableExist you are checking your DB Query results using a callback function. In there, …
function jquery datetimepicker is not found/work
why this is not working: datetimepicker is not a function jquery What is the right arrangement that will work? Answer You can get the bootstrap datetimepicker from here.
Issues with an Array.forEach [duplicate]
This question already has answers here: JavaScript: Difference between .forEach() and .map() (17 answers) map function not working in React (3 answers) Closed 22 days ago. Hope someone here would be able to help me out. I am trying to build an Owl-Carousel from an array of objects. but for some reason the arr…
Change number format and get it as a number
I am using MUI and Formik to create form. I need to change numbers format in the all inputs: 1000.00 -> 1.000,00 A created function formatNumber(num) to do this, it works. But problem is that it returns string, and my API wait number (I can do nothing with that). I tried to use react-number-format but it a…
How to add google map markers based on element entries when user changes it
I am a student who learns web development. I want to add google map markers based on select element entries. So I have created following HTML code to create dropdown list. To get user input value in every change, I have following JavaScript code. The window.cityName is the global variable which I used to get …
How to change the color of font everytime the value change?
I just want to ask if is it possible to change the color of the font when the value changes ? just like how trading platform works it will ticks the font . It changes the color from white to green ( when the value goes up and ) so I want to change the color of failed to red