It's flawed because 99.999% of the time your code will work just fine. Job done. Then one day, "undefined is not a function" and your airplane falls out of the air.
To some extent, yes, that happens in all languages. To some extent 10^100 and 1 are both numbers. That does not mean you can even compare them.