- // Create an array of friends.
- var arrFriends = new Array(
- // Get the day of the week.
- var intDayOfWeek = (new Date()).getDay();
- // Figure out which friend to call based on
- // the given day of the week. Call Luke on saturday.
- // For every other day, call Molly (my girlfriend).
- var strFriendToCall = arrFriends[ ( intDayOfWeek == 6 ) ? 3 : 0 ];
When I am figuring out which index of the Friends array to call, I determine the value based on the day of the week. It's an IF statement inside of object notation. Again, nothing ground-breaking. Just neat.
Looking For A New Job?
- Mid-Level Developer - Remote at Meeting Play
- Cold Fusion Developer/Designer at BPO Elks of the USA
- 10 year + CF lead Programmer/Developer with expert dot net/sql skills at Atprime Media Services
- ColdFusion Developer (advanced) at Intoria Internet Architects
- Full-time, remote CF Developer for Motorsport SaaS Company at MotorsportReg.com
thanks. kinda forgot i touhght i would google it and there you are
Awesome stuff :)