So I have a JavaScript object like this:
foo = {
\"one\": \"some\",
\"two\": \"thing\",
\"three\": \"else\"
};
I can loop this like:
This answer is similar to a couple of the others, but some users might find the code below easier to copy-paste for their own uses:
Object.keys(foo).reverse().forEach(function(key) { console.log(foo[key]) });
For an object "foo" as described in the question, this code will output the object elements in reverse order: "else", "thing", "some"