-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Description
I'm on Node JS 18.12.1 and I'm seeing the following behaviour:
const sizeof = require('object-sizeof')
> sizeof(["a","b","c","d","e"])
21
> sizeof("abcde")
20
> sizeof(["abcde"])
9
Why is an array of a string smaller than the string itself?
Why is an array of letters 1 byte bigger than the string? Shouldn't they be the same? Or may be the array is slightly bigger due to some reference?
Reactions are currently unavailable