Skip to main content

All Questions

4 votes
1 answer
94 views

Convert object with 'long.property.name' property to object tree

I want to transform such object from: foo = { 42: 'foo', 'a.b.c[0].42': 'bar', 'a.b.c[0].43': 'zet', 'a.d.c[0].42': 'baz' } To: ...
Dmytro Rudnitskikh's user avatar
7 votes
1 answer
47k views

Merging two arrays of objects with different keys/properties [closed]

I have two different arrays: ...
JulieMarie's user avatar
2 votes
0 answers
64 views

Extremely redundant HTML templating

This is horrendous. I'm using lodash's templating engine for this table. Here's the template for an individual record's row. I've got 5 different table and ...
Robin's user avatar
  • 201
7 votes
2 answers
5k views

"Invert" a JavaScript object hash whose values are arrays to produce a new object hash with keys as the elements of those original value vectors

Background lodash and underscore have an invert function that takes an object hash and converts it to a new one, which has keys as the input object's values and ...
Ahmed Fasih's user avatar
19 votes
2 answers
80k views

Deep pick using lodash/underscore

Use Case _.pick creates a shallow clone of an object given a predicate that identifies which keys to keep. pickDeep would ...
Pete's user avatar
  • 2,304