Concatenate Strings from Objects
Concatenate Strings from Objects
Given an array of objects with a specific property, concatenate all string values.
Requirements:
- Extract string property from each object
- Concatenate all strings together
- Handle missing properties
Example:
Input: [{ name: 'John' }, { name: 'Jane' }, { name: 'Bob' }]
Output: "JohnJaneBob"
Examples:
Input 1:
{"arr":[{"name":"John"},{"name":"Jane"},{"name":"Bob"}],"key":"name"}Output 1:
"JohnJaneBob"Loading editor...
Run your code to see results
Click the Run button above