All Questions
14 questions
7
votes
3
answers
187
views
JS function to initialize properties
I have some JavaScript code to manage a 2D map in a game. I have a function to create a new room in the map which is at map[x][y]. I need to create that property ...
4
votes
1
answer
384
views
Extract string list as array from an array of objects
Having the following array of objects of ingredients used by cooks
...
1
vote
1
answer
569
views
Creating a Navbar Menu from JSON data with Lodash
I am trying to create a navbar menu from JSON data. Actually I have achieved it but I am looking for feedback not to call getItems twice? How can I improve my code?
...
3
votes
2
answers
234
views
Array of objects to array
What would be the "correct" way of transforming an array of objects into an object that contains an array?
Suppose I have this array that contains objects:
...
2
votes
1
answer
109
views
Javascript map/filter/reduce over facebook messenger data
Context: I am making a website that allows people to upload their Facebook Messenger data, and see data visualizations for conversations. It is a React front-end, and a nodejs back-end. It doesn't ...
3
votes
2
answers
334
views
Counting data points, grouped by country, occupation, and age, for charting
I would like to chart my data. However, the data I get from server needs to be
completely transformed, and I would like to transform it as quick as possible. I believed reduce would be the best way to ...
5
votes
1
answer
10k
views
Finding an object in a nested object/array structure
I have an app with a bunch of questions defined in a yaml file. For various reasons I would like the data to be divided into sections (section_0, ...
2
votes
1
answer
4k
views
Check deep object property and find duplicate value
I use the following code to find if there is duplicate value in property path:
...
0
votes
1
answer
267
views
JSON encoder/decoder for bandwidth efficiency
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it ...
0
votes
1
answer
3k
views
Merging JSON objects with common values
I am trying to merge JSON objects which have common values.
This is the original JSON:
...
2
votes
1
answer
494
views
Nested loop to transform MongoDB results
I have the following structure returned from MongoDB:
...
1
vote
1
answer
175
views
Rendering JSON array as a tree
This code is working fine for me, but I want to simplify it.
Function parents is defining parents of the tree and children ...
8
votes
3
answers
2k
views
Ticket management system
I am building a ticket management system for a state server we use at work. Back end is node.js with multiple front ends. I am rewriting my back end to be more maintainable as the scope grows.
For ...
2
votes
1
answer
183
views
Most efficient way to insert into ordered sequence
I have a dashboard like interface, that can have many tabs. There can be as many or as few tabs as the user likes, with the user being allowed to re order them as they wish. Exactly like browsers do.
...