break_eternity.js icon indicating copy to clipboard operation
break_eternity.js copied to clipboard

enforce usage of constants instead of constructing decimals on the spot?

Open Patashu opened this issue 6 years ago • 2 comments
trafficstars

pros: less object construction/destruction.

cons: decimals aren't immutable, so someone could accidentally change the value of 0 and break everything.

so the time/memory savings would have to outweigh the threat of destruction.

Patashu avatar Mar 15 '19 22:03 Patashu

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze

Razenpok avatar Mar 18 '19 11:03 Razenpok

Oh, that sounds very useful...

Patashu avatar Mar 18 '19 12:03 Patashu