myComponent.map is not a function

I have this information right now that i’m saving and trying to pass to a component who then tries to create Tabs and TabPanel (Material-ui components) with said info. The declaration of that info …

How filter and sort in a nested tree Array in javascript?

I need to filter and sort a nested tree object for menu so is sort and filter status === true ,How to turn to const items = [{ name: “a1”, id: 1, sort: 1, status: true, …

creating alt tags for images gotten through JSON

This web page has three cards with information above and an image below. I am using JavaScript and HTML to get the information that goes to my web page. My JavaScript gets the information it needs …

push even and odd numbers to respective arrays using a for loop

I’m a total beginner and I’m stuck completely on this problem. I’m supposed to use a for loop to traverse an array, pushing odd numbers to the ‘odd’ array, and evens to the ‘even’ array. No numbers …

How can I remove occurrences with random hash?

I have a controlled in my React application where the user would type. I want to keep track on it and replace the occurrences of $.text and $.lang to random hashes/number. from let …

Evenly distribute 2 different values inside an array with JavaScript

I have an array of 2 different values and they need to be distributed evenly. For example: array = [1, 1, 1, 1, 1, 2, 2, 2, 2, 2] and the result I want is: array = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2] But …

Javascript arrays email substring into full name, firstname and lastname

I know my questions are similar to other questions but I could not figure it. I am practicing javascript. I have arrays of emails. from that email I want to get three out puts of strings fullname, …

Combine two array into one while getting the sum of instances in second array

I have two arrays. The first array is this: arrayOne = [ {id: 1, type: ‘Animal’, legs: 4}, {id: 2, type: ‘Animal’, legs: 2}, {id: 3, type: ‘Animal’, legs: 8}, {id: 4, type: ‘Plant’, legs: 0}, ] This …

How to process the Azure REST API response in PHP

I am getting the below response with Azure rest API { “value”: [ { “id”: “/subscriptions/xxxx-1faf-4756-a709-1af49be58e56/resourceGroups/cloud-shell-…

Vue/Javascript – Sort array of objects based on its existence in another array

I have two arrays, array1 has all objects and array2 has filtered objects based on a search string. Currently I am rendering array2 (which will contain all objects from array1 when the search string …