Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
* Derived from an answer at StackOverflow
* Answer: http://stackoverflow.com/a/40737306/3543437
* Question: http://stackoverflow.com/questions/8312459/iterate-through-object-properties
* Answer Author: http://stackoverflow.com/users/1073330/frank-roth
* Purpose: Illustrate how the single-liner can be split up into multiple lines using map((key)=>(value))
*/
Object
.keys(mock_json_complex)
.map
(
(e) =>
(
console.log(`key=${e}`),
console.log(`value=${mock_json_complex[e]}`)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment