I'm a bit lost on Auxiliary Space Complexities.
In the lecture that I am taking the instructor states that strings have a space complexity O(n), since the length of the string(n) will vary. But primitives such as numbers, booleans, undefined, etc have a constant space complexity O(1).
I'm confused because if the space of strings differ by its length, would that not be the same with numbers as well? Since they also will have different "lengths"?
I do understand how booleans and undefined is O(1), I mean true/false, undefined and null are length-independent instances.
If anyone can clarify this for me, I would appreciate it.