Let's think about this class:
class A {
num: number;
str: string;
someFunction(){console.log("SomeFunction called!")}
}
The memory allocation for the someFunction
method is a question mark. Is this function stored in memory only once for all instances of class A
, or does each object created allocate memory to store someFunction
?