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


Groups > comp.lang.javascript > #16187

Re: Reference basics (Was: Question about reference to style properties)

From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.javascript
Subject Re: Reference basics (Was: Question about reference to style properties)
Date 2012-09-27 15:16 +0200
Organization A noiseless patient Spider
Message-ID <k41jj5$gp9$1@dont-email.me> (permalink)
References <50640679$0$6987$e4fe514c@news2.news.xs4all.nl> <k411ie$91d$1@dont-email.me> <50640d5c$0$6873$e4fe514c@news2.news.xs4all.nl> <5064402f$0$6573$9b4e6d93@newsspool3.arcor-online.net> <50644a9a$0$6912$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


Am 2012-09-27 14:46, Erwin Moller meinte:

> What confuses me a lot is that:
> var es = el.style;
> now es holds a reference to el.style;
>
> while
>
> var ed = el.style.display;
> now ed does NOT hold a reference to el.style.display;
>
> Is the reason for that that the former is an Object and the later is a
> primitive type?

Yes. With objects only the object reference is "cloned" and assigned to 
the variable.

Gregor

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


Thread

Question about reference to style properties Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-09-27 09:55 +0200
  Re: Question about reference to style properties Gregor Kofler <usenet@gregorkofler.com> - 2012-09-27 10:08 +0200
    Re: Question about reference to style properties Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-09-27 10:25 +0200
      Re: Question about reference to style properties Gregor Kofler <usenet@gregorkofler.com> - 2012-09-27 14:03 +0200
      Re: Question about reference to style properties Martin Honnen <mahotrash@yahoo.de> - 2012-09-27 14:01 +0200
        Reference basics  (Was: Question about reference to style properties) Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-09-27 14:46 +0200
          Re: Reference basics  (Was: Question about reference to style properties) Martin Honnen <mahotrash@yahoo.de> - 2012-09-27 15:09 +0200
          Re: Reference basics  (Was: Question about reference to style properties) Gregor Kofler <usenet@gregorkofler.com> - 2012-09-27 15:16 +0200
          Re: Reference basics (Was: Question about reference to style properties) Scott Sauyet <scott.sauyet@gmail.com> - 2012-09-27 06:35 -0700
            Re: Reference basics (Was: Question about reference to style properties) Scott Sauyet <scott.sauyet@gmail.com> - 2012-09-27 06:42 -0700
            Re: Reference basics (Was: Question about reference to style properties) Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-10-01 09:14 +0200

csiph-web