Skip to content

Instantly share code, notes, and snippets.

@the-nose-knows
Created April 19, 2017 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-nose-knows/9f06e745a56ff20519707433e28a4fa8 to your computer and use it in GitHub Desktop.
Save the-nose-knows/9f06e745a56ff20519707433e28a4fa8 to your computer and use it in GitHub Desktop.
/*
* 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