Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一系列的 JS 计算,这些计算Infinity取决于用户的选择。如何停止该值的Infinity出现,例如,0.0改为显示?
Infinity
0.0
这个怎么样:
value = isFinite(value) ? value : 0.0;