Javascript memory impact of null vs undefined
问题 I work in an area where memory utilization is very important to us, as we don't run on your classic web browsers / hardware. We use null quite a lot in our application, one thing that has not been clear to me is if null takes up more space than assigning a variable to undefined. Do we know if one or the other is more costly on memory usage? Thanks for help! 回答1: As you can see in this jsperf test, null seems to be slightly faster in the chrome (V8, just like nodejs) which might indicate it