Joined February 2014
·
Posted to
JavaScript iterate through object keys and values
over 1 year
ago
The showObject method here is not really useful in itself, as we could use JSON.stringify() to acheive this result. I was just putting this in as a reference as to how to iterate through all keys and values in an object. I will rename the pro tip to that.
It could be useful to use this approach to create an array of all the keys in an object and pass that back, or we could pass in a function to a method like this which iterates through the keys and values, and calls the function for specific values.
Posted to
JavaScript design patterns
over 1 year
ago
Thanks for the feedback, I have amended the Singleton example
thanks, fixed it up