Archive for May, 2009

Nifty Little Javascript Array Trick

This may well be common knowledge, but to me I’ve found this little trick immensely useful.

Because Javascript automatically resizes arrays when you add a new item, this nifty little syntax works great for building a new array or adding items on the end:

1: var ar = []; 2: for(var i = 0; i < 50; ;++) { 3: ar[ar.length] = "Some value " + i; 4: }

Obviously the push() and pop() methods work well too, but I find the above syntax slightly more readable since I don’t typically expect an array to have methods like push() and pop().

Continue Reading 2009/05/18 at 23:08 1 comment

My Most Recent Updates

  • Well, after a few hours, I finally have my azure resources consolidated. Actually saving some money now! 5 days ago
  • Doing a bit of well overdue digital housekeeping. Deleting resource groups and app services left and right! 1 month ago
  • Just finished migrating all my CodePlex projects to GitHub. Bitter sweet, my first OSS contributions were on CodePlex, but its for the best. 1 month ago
  • RT @arstechnica: "These idiots run directly up to your armed-to-the-teeth hero and attack one-at-a-time—like a bad Chuck Norris film" https… 1 month ago
  • VSTS has got some nice stuff going on with Build and Release management. Makes deployments as easy as pie. 1 month ago
  • Suffering from lots of self inflicted minor obstacles, on something I know how to do a different way starting to annoy me. 1 month ago
  • @DrPizza They could at least smooth out the animation on those cogs. Two frames seems awfully low, even for a system update screen. 2 months ago
  • RT @Jimminy: *golf claps* to @apple for focusing all their efforts on making design and usability worse across both hardware and software f… 8 months ago
  • RT @AdamJosephCook: @trevorghess @natebross Indeed. I do not understand why @Meetup is not more prompt about this. The events are clearly j… 8 months ago
  • @trevorghess any word on the coup for the azure meetup group? 8 months ago