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


Groups > comp.lang.javascript > #16183

Re: Question about reference to style properties

From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.javascript
Subject Re: Question about reference to style properties
Date 2012-09-27 14:03 +0200
Organization A noiseless patient Spider
Message-ID <k41fb5$ld9$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>

Show all headers | View raw


Am 2012-09-27 10:25, Erwin Moller meinte:

> And just to make sure I understand it alright:
> Is the following explanation correct?
>
> var el = document.getElementById("whatever");
>
> --> el.style.display returns a string, which is a primitive type.
> --> el.style returns a reference to an object.
>
> And is it correct to state that:
> var myvar = el.style.display;
> will create a *new string*, and assigns that to myvar, only using
> el.style.display to produce the value from some internal interpretation
> in the browsers DOM?

The right part of the assignment operator is evaluated, this result of 
this evaluation is assigned to the left part - I suppose it depends on 
the ES implementation whether a temporary "new string" is created.

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