Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
2 answers
59 views

How get total in an array of object [duplicate]

I have this array, and i want to get the sum amount of each Order.item [ {"OrderReceiverId":"6698eea782e24cc9d42eab7f", "Order":{ "CustomerId":"...
Osemu Aimiosior's user avatar
-2 votes
1 answer
50 views

In JavaScript, how do I check if there are objects with the same value in an array? (a little different) [closed]

How do I check if there are objects with the same value "name" in an array? Input: [ { "name": "blabla", "value": "537,52" }, ...
eyuq's user avatar
  • 1
0 votes
1 answer
35 views

How do get search filter data in es6

// Filter rows based on string values and exclude from whiteList const whiteList = rows.map(sel => sel.RuleAutoID); // Array of IDs to exclude console.log('whiteList', whiteList); // Assuming you'...
user1931511's user avatar
-2 votes
2 answers
42 views

I want to return a key using Lodash when it contains a particular value

I have an object like this: const obj = { 'MONEY-OUT': { USD: ['a', 'b', 'c'], EUR: ['d', 'e', 'f'], }, 'MONEY-IN': { USD: ['g', 'h', 'i'], EUR: ['j', 'k', 'l'], }, }; and I ...
testerJuan's user avatar
3 votes
2 answers
62 views

Traverse over tree type structured data uing JavaScript

I have a data set having parent and nested children in it. The purpose of this data is to traverse over parent to -> child1 to-> Child1Child ..... -> child2 to -> child1 to -> child2 ...
vikas dhiman's user avatar
0 votes
0 answers
51 views

How do I store a parametrized string in database?

My question is in the context of JavaScript. Consider the object {'name':`${name}`,'age':10} My goal is to store this object in a database and then retrieve it in another session. The other session ...
theGreedyLearner's user avatar
-3 votes
0 answers
29 views

Pros and Cons of using an object and IIFE [duplicate]

I would simply love to learn and comprehend the advantage and disadvantages of the use of Object and IIFE. See the codes below: const calculator = { add : (a, b) => a + b, sub : (a, b) =&...
siyel's user avatar
  • 5
0 votes
1 answer
14 views

i want to create a modal, when i click on button having id a modal should be opened having card

i have created a courses page and create a fullscreen which should be opened when button is clicked modal is also opened but i am having an error in JS. let value = colc[details.target.id] if(details....
faryal sz's user avatar
-1 votes
1 answer
52 views

Javascript : Find node value through recursive iteration

I have the following structure : var content = { "id": "RkktMTA1OC0wNTE3QElNQi82NTAwNC9YLzAwSDc", "name": "FI-1058-0517", "category": &...
BlackPage's user avatar
  • 103
-2 votes
2 answers
56 views

How can I get last three values from array of objects [closed]

I have an array of object with a few values. I would like to get only last, three values (ownerSurname, color and bark). I tried to use slice or length but with failure. const myValues: MyValues<...
Emm's user avatar
  • 9
1 vote
2 answers
61 views

React updating a value in a mapped object from child component [duplicate]

using React I've been able to update a value of an object stored in the parent component from a onChange() made in a child component. However I'm trying to do the same with a component that is created ...
Chobbit's user avatar
  • 493
-3 votes
0 answers
44 views

my function that returns an object of methods keeps returning undefined (react-native) [duplicate]

while trying to make a document editor like word (it's a very basic editor) I tried to use classes but what I wanted didn't work and so I created a big function that returns 2 variables and a method ...
No0bYebY's user avatar
0 votes
0 answers
83 views

Do we need to clear class to prevent memory leak?

In the following script, this class is used to store a lot of Geojsons object (for google maps api): class MapService { private layers: Map<string, google.maps.Data> = new Map() ...
Raphael Rlt's user avatar
-1 votes
2 answers
46 views

keep getting TypeError: array.push is not a function when trying to push an object into an existing array with objects

I'm learning about localStorage and I'm trying to build a basic shopping cart function. The process is: user clicks on "Add To Cart" button. If localStorage("shoppingCart") doesn'...
Lexiriam's user avatar
-3 votes
1 answer
65 views

Javascript Object Array, Iterate over only one object

I have a javascript array object. I want to find the result of a single array. The following code does what I want but always iterates over the whole array. How can I achieve the same on just one ...
London28's user avatar
  • 101

15 30 50 per page
1
2 3 4 5
1789