I think it's just for effect - the point of the article is determining which elements to act on. The author mentions you could just apply centering to the element instead.
Depending on the logic in the site, that may be true. However you can't use the technique used here verbatim, as it relies on being able to use the last element and the nth element together to determine the number of elements and whether or not the element should be stretched.