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


Groups > comp.lang.javascript > #38252

Re: Object values (continued)

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Object values (continued)
Date 2020-03-17 17:51 +0100
Organization PointedEars Software (PES)
Message-ID <4544588.31r3eYUQgx@PointedEars.de> (permalink)
References <8f3v6ft5nntnuc7qi27q8if1crb40499hp@4ax.com> <1w7ujei4y9bez.k70pvfchqjrm$.dlg@40tude.net>

Show all headers | View raw


JJ wrote:
^^
Your real name belongs there.

> On Mon, 16 Mar 2020 14:34:50 +0000, John G Harris wrote:
>> I really cannot understand why some people are fixated on references.
> 
> In JavaScript, everything are objects.

Wrong; there are primitive values, which is *basic* knowledge:

<https://www.ecma-international.org/ecma-262/#sec-ecmascript-language-types>

> Objects are basically memory pointers to a data structure.

Wrong; objects *are* the data structures.

> JavaScript treat those memory pointers as references,

Wrong; it is exactly the other way around.

> and uses references as values -

Correct.

> even for primitive values such as Boolean, Number, String, etc.

Wrong.  This is *at least* implementation-dependent.

> It's why we can call a method from a
> primitive value. e.g. `("a").toUpperCase()`.

Wrong.  The expression

  ("a")

is being *JIT-converted* to an immutable String instance as if by the 
expression

  new String("a")

In this particular case, the parentheses even can be omitted (there are 
other cases in which the grammar requires them).

> Except that any changes to the object's container (basically, the data 
> structure), is ignored. e.g.
> 
>   var a = 123;
>   a.prop = 456;
>   console.log(a.prop); //undefined

In strict mode, the assignment

  a.prop = 456;

is NOT ignored, but throws a TypeError exception *because* a holds a 
*primitive* value, NOT an object value.

<https://www.ecma-international.org/ecma-262/#sec-putvalue>
 
>> There is a way to implement values that puts an object right inside
>> the value field, yet allows several variables/properties to share
>> the same object.
> 
> That's already the actual design of JavaScript. Object properties store
> values, and those values are already references.

Blind leading the blind.
 
>> Perhaps the other way is too advanced a software technique for them
>> to understand.
> 
> Not everyone here understand or even bother with programming languages
> other than JavaScript.

And you obviously do not even understand what you mistakenly think would be 
"JavaScript".
 
> Also, JavaScript is a high level programming language.

For suitable values of “high”.  In many respects strictly standards-
compliant ECMAScript implementations (e.g. excluding TypeScript and other 
transpilers) are very low-level compared to e.g. Python.

It would be a Really Good Idea[tm] if you stopped talking about things that 
you know nothing about.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

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


Thread

Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-16 14:34 +0000
  Re: Object values  (continued) Jon Ribbens <jon+usenet@unequivocal.eu> - 2020-03-16 14:52 +0000
    Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-16 18:19 +0000
      Re: Object values  (continued) Jon Ribbens <jon+usenet@unequivocal.eu> - 2020-03-16 20:06 +0000
        Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-17 19:01 +0000
          Re: Object values  (continued) Jon Ribbens <jon+usenet@unequivocal.eu> - 2020-03-17 19:55 +0000
            Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-18 17:29 +0000
  Re: Object values  (continued) JJ <jj4public@vfemail.net> - 2020-03-17 12:48 +0700
    Re: Object values  (continued) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-03-17 17:51 +0100
      Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-17 19:03 +0000
        Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-18 07:20 +1100
          Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-18 17:29 +0000
            Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-19 14:21 +1100
              Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-19 11:12 +0000
                Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-20 14:33 +1100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-20 09:21 +0000
                Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-21 09:56 +1100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-21 11:18 +0000
                Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-22 08:45 +1100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-22 10:10 +0000
                Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-23 07:44 +1100
    Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-17 19:09 +0000
      Re: Object values (continued) Richard Damon <Richard@Damon-Family.org> - 2020-03-17 16:21 -0400
        Re: Object values (continued) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-03-17 22:57 +0100
  Re: Object values  (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-19 05:32 -0700
    Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-19 15:26 +0100
      Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-19 18:16 +0000
    Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-19 18:15 +0000
      Re: Object values  (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-19 11:54 -0700
        Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-20 09:11 +0000
          Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-27 15:35 +0000
            Re: Object values  (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-27 09:59 -0700
              Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-28 14:09 +0000
                Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-29 14:18 +1100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-29 10:40 +0100
                Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-29 04:41 -0700
    Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-21 14:12 +0000
      Re: Object values  (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-21 19:45 +0100
        Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-22 10:30 +0000
          Re: Object values  (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-22 23:30 +0100
            Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 09:44 +0000
              Re: Object values  (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-23 11:19 +0100
                Re: Object values  (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-23 05:00 -0700
                Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 18:05 +0000
                Re: Object values  (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-23 11:50 -0700
                Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 19:34 +0000
                Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 18:14 +0000
                Re: Object values  (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-23 22:21 +0100
                Re: Object values  (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-24 14:09 +0000
                Re: Object values  (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-25 00:01 +0100
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-24 01:18 +0100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-24 14:24 +0000
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-24 15:43 +0100
                Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-24 11:03 -0700
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-24 18:23 +0000
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-24 22:19 +0100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-25 16:34 +0000
                Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-25 23:17 +0100
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 01:27 +0100
                Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-26 18:58 +1100
                Re: Object values (continued) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-03-26 10:43 +0000
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 12:22 +0100
                Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-26 10:08 -0700
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 18:29 +0100
                Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-26 14:17 -0700
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 23:37 +0100
                Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-26 16:40 -0700
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-27 11:38 +0100
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-26 18:11 +0000
                Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 19:41 +0100
                Re: Object values (continued) "Mark-" <nospam@mapson.xyz> - 2020-03-25 00:00 +0000
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-25 15:05 +0000
                Re: Object values (continued) "Mark-" <nospam@mapson.xyz> - 2020-03-25 20:12 +0000
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-26 18:09 +0000
                Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-25 19:39 +0000
            Re: Object values  (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-23 18:49 -0700

csiph-web