Suppose I have the following function signature:
function test(varible1, varible2) {}
When I call it I pass only one parameter:
test(5);
So within test
function the variable2
still be created but will have value of undefined
. I'm wondering if js engine still allocates 32 bit in the memory for that variable?
I can't find the size of undefined and I'm sure it varies with engine, but I assume that the best case is 32 bits. The variable exists, so it needs a value to even know it's undefined. That value is very likely a pointer which will be 32 or 64 bits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With