That’s a terrible idea:
parseInt(0.000001) // 0
parseInt(0.0000001) // 1 parseInt(0.000001) // 0
parseInt(0.0000001) // 1parseInt() only accepts strings as input. So JavaScript calls .toString() on the number before passing it as an argument.
(0.000001).toString() // "0.000001"
(0.0000001).toString() // "1e-7"
By the way, TypeScript or Flow would have caught this error during compile time.