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


Groups > comp.lang.javascript > #37261

Re: Object equals other object

From John G Harris <niam@jghnorth.org.uk.invalid>
Newsgroups comp.lang.javascript
Subject Re: Object equals other object
Date 2019-09-16 10:04 +0100
Organization A noiseless patient Spider
Message-ID <evjunel40s4tv695ks52c89mmd2v66rmhp@4ax.com> (permalink)
References <Z4edne0EI5e3auPAnZ2dnUU7-dPNnZ2d@westnet.com.au> <XnsAACC5BADA63FDeejj99@194.109.6.166> <RMadnQGkRsK51eLAnZ2dnUU7-I3NnZ2d@westnet.com.au>

Show all headers | View raw


On Mon, 16 Sep 2019 18:30:26 +1000, Andrew Poulos
<ap_prog@hotmail.com> wrote:

  <snip>
>Yes, but why can't two objects that have exactly the same properties and 
>corresponding property values be considered the same? If I JSON 
>stringify both of them then they magically become the same, so why not 
>before?

Well, you would need another equals operator for that. ==== ?

Ordinary === says that if true and you alter one object then the other
will also be altered. I.e They are the *same* object.

Would your ==== be true if the objects have different prototypes?

  John

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


Thread

Object equals other object Andrew Poulos <ap_prog@hotmail.com> - 2019-09-16 12:44 +1000
  Re: Object equals other object "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-09-16 09:00 +0200
    Re: Object equals other object Andrew Poulos <ap_prog@hotmail.com> - 2019-09-16 18:30 +1000
      Re: Object equals other object Julio Di Egidio <julio@diegidio.name> - 2019-09-16 02:01 -0700
        Re: Object equals other object Andrew Poulos <ap_prog@hotmail.com> - 2019-09-16 19:39 +1000
        Re: Object equals other object John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-16 18:29 +0100
      Re: Object equals other object John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-16 10:04 +0100
        Re: Object equals other object Julio Di Egidio <julio@diegidio.name> - 2019-09-16 02:21 -0700
          Re: Object equals other object John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-16 18:39 +0100
          Re: Object equals other object Arno Welzel <usenet@arnowelzel.de> - 2019-09-17 10:45 +0200
      Re: Object equals other object Arno Welzel <usenet@arnowelzel.de> - 2019-09-16 11:49 +0200
        Re: Object equals other object Julio Di Egidio <julio@diegidio.name> - 2019-09-16 02:54 -0700
          Re: Object equals other object Arno Welzel <usenet@arnowelzel.de> - 2019-09-16 11:56 +0200
            Re: Object equals other object Julio Di Egidio <julio@diegidio.name> - 2019-09-16 03:09 -0700
              Re: Object equals other object Arno Welzel <usenet@arnowelzel.de> - 2019-09-16 13:47 +0200
                Re: Object equals other object Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-09-16 13:43 +0000
  Re: Object equals other object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-09-17 00:53 +0200
    Re: Object equals other object Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-09-16 23:03 +0000
      Re: Object equals other object "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-09-17 16:16 +0200
        Re: Object equals other object Arno Welzel <usenet@arnowelzel.de> - 2019-09-17 16:57 +0200
      Re: Object equals other object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-09-17 16:58 +0200
        Re: Object equals other object Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-09-17 16:31 +0000
        Re: Object equals other object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-11-30 04:38 +0100
    Re: Object equals other object John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-17 18:46 +0100

csiph-web