I am looking for a way to loop through an object but starting for example some where in the middle or any other value, for example: Tue, Wen, Thu, Fri, Sat, Sun, Mon instead of Sun, Mon, Tue, Wen, Thu, Fri, Sat(as the object used in the example).
// basic week overview
daysByName = {
sunday : 'Sun',
monday : 'Mon',
tuesday : 'Tue',
wednesday : 'Wed',
thursday : 'Thu',
friday : 'Fri',
saturday : 'Sat'
}
// basic loop
for (var key in daysByName) {
console.log(daysByName[key]);
}