Skip to main content

All Questions

Tagged with
0 votes
2 answers
80 views

How to filter an array that has mixed data types

I have an array which is like this: const AllFiles = [ {name: "ExistingFile1", mimetype: "image/jpg", size: "500"}, [ File, // This is the New File itself ...
volume one's user avatar
  • 7,315
-1 votes
2 answers
103 views

Sorting/Manipulating an array of objects

I need help in writing a function to sort an array of objects all objects with xid are bottom in array object (assume A) which has options array might contain xid in step object, This xid is also ...
Sid's user avatar
  • 1
1 vote
1 answer
91 views

Definition of `integer index` in JavaScript (ECMAScript 2015)

I'm trying to understand how a JavaSript object sorts its properties. As far as I understood, from ECMA262, the first properties are always an integer index properties. For example, if print these ...
Sergey Shandar's user avatar
1 vote
1 answer
40 views

sum the value inside array of objects based on multiple conditions

I have this object [ { "year": 2020, "term": 1, "worthAmountEGP": 0 }, { "year": 2020, ...
Mohamed Khalifa's user avatar
0 votes
1 answer
19 views

Make object key as value and assign new key to value in array of objects

I have an array of objects with multiple properties. I want to be able to make the property's key a value and assign a new key to my value. My code: var list = [ { you: 100, me: 75, ...
nb_nb_nb's user avatar
  • 1,347
2 votes
0 answers
93 views

Javascript Object() vs new Object() for ES6

I've seen a number of questions about new Object vs new Object() or new Object() vs {}, but I'm wondering about what the difference is between Object() and new Object()? In other words, what's the ...
mishar's user avatar
  • 455
0 votes
0 answers
25 views

Array not returning pushed values from Function [duplicate]

I declare an array outside of a function and push values inside the function. How do I get that array populated outside the function? My code: const higher_fnc = (query_name) => { return axios({ ...
nb_nb_nb's user avatar
  • 1,347
0 votes
0 answers
16 views

Object not getting populated by Axios Function [duplicate]

I have an axios function using GraphQL. It is a nested axios that is supposed to populate an object but is not. What is missing in my code? My code: const higher_fnc = (query_name) => { return ...
nb_nb_nb's user avatar
  • 1,347
-1 votes
4 answers
64 views

Add values from Array to every Object in Array

For a project i need to push the values of an array into every object in another array. What i have so far: closed_status = [{ "project_no": 5, "priority": 3, "s_status": "S8", "...
user avatar
0 votes
1 answer
36 views

Neater way to assign to variable from Object

Is there a neater way to assign the values to objects rather than what I have: My code: let val1 = result.data.data.table.val1; let val2 = result.data.data.table.test.val2; let val3 = result.data.data....
nb_nb_nb's user avatar
  • 1,347
2 votes
3 answers
59 views

Neater way to create an object

I am creating an object with values from an api response. Is there a neater way to do this? My code: const variables = { name: result.data.data.table.name, org: the_org, val1: result.data....
nb_nb_nb's user avatar
  • 1,347
0 votes
0 answers
212 views

Error when passing array of objects as variable in graphQL

I am trying to pass an array of objects as a variable in a graphQL mutation. The variables are populated from a forEach loop and pass the mutation to an axios function. My code: const query = "...
nb_nb_nb's user avatar
  • 1,347
-1 votes
1 answer
24 views

Add to object with every iteration without replacing

I have an object outside of the function that I want to populate with every iteration and call that object after the iteration is done but I am only able to see the last element in my object. How do I ...
nb_nb_nb's user avatar
  • 1,347
0 votes
2 answers
62 views

Transform the array of object or nestobject into desire format

I am trying to transform the array object into new object with some new key name and rest of the key convert into cameCase Example: 1. Old Key to New Key name old key: orgId converting into ...
Pramod Kharade's user avatar
-3 votes
1 answer
951 views

How to iterate over Json object in javascript or Ecmascript? [duplicate]

I have this json Response and having difficulty in iterating over this json structure.The idea is to print the numbers written within the square brackets if they match with "Data" Json which ...
Mayo's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
73