Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #34456

Trying to understand OOP, Umpteenth time

Newsgroups comp.lang.javascript
Date 2018-01-05 06:10 -0800
Message-ID <ff64c61e-75f0-43c3-b003-a6f2ef8ba3fc@googlegroups.com> (permalink)
Subject Trying to understand OOP, Umpteenth time
From bit-naughty@hotmail.com

Show all headers | View raw


OK, so I think I get it. If you have a class X (OK, you can't, but maybe by now you can...ugh! I donno, you get my point?), you can say var foo = new X() ; ,and then you can execute stuff *inside* X like this: foo.m() ;.

But then you can also do var bar = new X();, and then you'd have a second instance of X, right? My question is WHY? Why would you need the same thing twice?? ie. in short, what is the whole POINT of doing OOP? Where would you NEED to do the var bar stuff, after you'd already done the var foo?

Thanks for you guys' help, as always.

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Trying to understand OOP, Umpteenth time bit-naughty@hotmail.com - 2018-01-05 06:10 -0800
  Re: Trying to understand OOP, Umpteenth time "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-05 15:48 +0100
  Re: Trying to understand OOP, Umpteenth time John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-05 15:14 +0000

csiph-web