Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (anonymous):

How would you name these functions?

OpenStudy (anonymous):

I'm wondering what you would guys would think is a good name for this function. What it does is it takes an object of arrays and turns it into an array of objects. I'll give a simple example: ``` Input: { name: ['Alice', 'Bob', 'Charlie'], age: [23, 19, 40] } Output: [ { name: 'Alice', age: 23 }, { name: 'Bob', age: 19 }, { name: 'Charlie', age: 40 } ] ``` So far I've been calling it the transpose, but I don't think that completely fits.

OpenStudy (anonymous):

While I'm at it, I have a couple other functions I'm trying to name as well. This one takes a delimiter and an object and when a key has a certain delimiter it knows it needs to nest the key into a nested object. ``` Input { name_first: 'John', name_last: 'Doe', age: 53 } Output { name: { first: 'John', last: 'Doe' }, age: 53 } ```

OpenStudy (anonymous):

A more recent one I've made but haven't come up with a good name will take any object whose keys all go to null values, and make the object itself null ``` Input { message: 'How are you?', image: { file: null, size: null } } Output { message: 'How are you?', image: null } ```

OpenStudy (anonymous):

The first one seems a little like zipping two lists (except instead of tuples you have JS objects)

OpenStudy (anonymous):

JS objects, could probably be just called maps

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!