Did you notice that there is a difference between classes and and objects? You can define a function within a class, but you cannot use it there. You will need to create an instance of the class (-> an object) to "use" a class method. But each object hast it´s individual, separated namespace and memory. THAT makes the difference.
Web Dev full-stack [LAMP] since 2005, but much heavier on the JS stuff these days.
Jack of all Stacks, Master of some.
Always looking to learn new things. Always glad to help out, just ask.
Location
Atlanta, GA
Education
B.S. in Biochemistry 2004, M.S. in Computer Information Systems 2007
Frankly, it makes ZERO difference in about 99% of code any of us ever write. On rare ocassions you might create something where the memory usage actually affects performance, and then you generally just rewrite it or split it into more objects or functions and get it working better.
My comment was just about how javascript terminology sucks and really we don't need many of the terms with really complicated explanations when "a function within a function or class" suffices, that's all.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Did you notice that there is a difference between classes and and objects? You can define a function within a class, but you cannot use it there. You will need to create an instance of the class (-> an object) to "use" a class method. But each object hast it´s individual, separated namespace and memory. THAT makes the difference.
Frankly, it makes ZERO difference in about 99% of code any of us ever write. On rare ocassions you might create something where the memory usage actually affects performance, and then you generally just rewrite it or split it into more objects or functions and get it working better.
My comment was just about how javascript terminology sucks and really we don't need many of the terms with really complicated explanations when "a function within a function or class" suffices, that's all.