I don't like checking for type of undefined. Why not just check if it has a truthy value?