All Questions
104 questions
0
votes
1
answer
77
views
Combine array of objects into another array per table row
I have a checkout table from where I obtain the values to later send as an API POST request.
I've built two separate arrays and now I need to combine them, and I'm having trouble to achieve this.
This ...
-1
votes
1
answer
40
views
Jquery Object and Array implementation
I have an Object
let data = {
a: 1,
b: 2,
c: {
abc: "ak",
bcd: "gh",
cfv: "ht"
}
}
then I have ...
1
vote
1
answer
146
views
How to turn an array of arrays with varying length into a nested object tree in javascript
I need to process files that are structured like
Title
/foo/bar/foo/bar 1
/foo/bar/bar 2
/bar/foo 3
/bar/foo/bar 4
It's easy enough to parse this into an array of arrays, by splitting at every / and \...
-2
votes
2
answers
120
views
Efficient jQuery / JavaScript code to calculate average values in array of objects
I have a large JavaScript array of objects. Each object contains temperature data for each month for many years. I would like to find the average temperature data for each temperature-type for each ...
-2
votes
1
answer
39
views
How to fetch the value of the checkbox that is stored in name array
As im dispalying the check boxes with buttons in UI for user to check the books that they currently using, as fivebooks array contains book name and the publication details of the book, as the user ...
1
vote
3
answers
109
views
How to get value based on key from an array of objects javascript
I have an array which I get from Database as below
var sampleArray =
{ID:1, ANALYSIS_NAME : "name1",
custodians:"[{\"ID\": 1, \"NAME\": \"abc\"},
...
-1
votes
2
answers
219
views
Create a filtered copy of JavaScript object with arrays
I'm new to JavaScript/jQuery and there's probably an easy way to do this, but I'm unable to find the function or syntax I need. Basically, I have a set of objects like this:
{
"Object1": [
...
1
vote
4
answers
573
views
Convert Array into Object of Keys and Values using javascript/jquery [duplicate]
I am having troubles converting an array into an object of keys and values.
Currently, I have the following nested array:
var array = [[id1, parent1, "name1", "desc1"], [id2, ...
0
votes
1
answer
175
views
Store options from select in JSON/Array/Object using jQuery
I'm hoping to get some help with the following:
So, I have this in my HTML structure (Generated via WordPress)
<select class="items">
<option value="0" selected="...
1
vote
3
answers
141
views
Remove array from object if great grandchildren arrays are empty
So I have an object which has a structure like
object.childArrays.grandchildArrays.greatgrandchildArrays
I want to remove the child array if any of the subsequent arrays are empty. (also can't use ...
0
votes
0
answers
26
views
jQuery: sorting array of object according to values between 2 separators
Is it possible to sort an array of objects according to two columns but only taking account the values between 2 separators ?
I would like for instance to sort in a descending way by size and then by ...
0
votes
2
answers
185
views
Concatenate multiple array of objects into one and use outside of function
I want to concatenate multiple array's into one. My result here is giving multiple array of objects. I want to push all them into a single array. All of them are array's of 5. I want to push each of ...
0
votes
1
answer
726
views
Add missing keys, values and data to json object
I have a large piece of json data that dynamically change but. Each JSON Object has a date, site_nm and more values. The dates dont match for all. The distinct dates in this dataset are: 2019-10-01,...
0
votes
1
answer
36
views
How to randomly select an object with a specific property value out of an array
I am creating a timed trivia game that randomly selects a question stored in an object from an array. Currently, I have the program randomly select a question from the array but it will sometimes ...
0
votes
4
answers
96
views
Javascript removing an object element from an array in a clean way (not leaving a null ghost)
I have an array:
var Array = {};
Array['elements'] = [];
Array['elements'][0]['name'] = "Sally";
Array['elements'][0]['age'] = "20";
Array['elements'][3]['name'] = "Jack";
Array['elements'][3]['age'] ...