In several places, I have loops over a pre-defined set of values.
My current code is:
for (var period in {'today':true,'yesterday':true,'this week':true,'last week':true,'this month':true,'last month':true}) {
...
}
It works, but is there a prettier way of doing this?
(period
needs to be the values, not the index, otherwise I would use an array.)