Cost validity check

I just scanned this: http://stackoverflow.com/questions/2801601/why-does-typeof-nan-return-number
Just to be safe, I would evaluate isNaN(t.cost) first.