---
title: "Meaning & Key Takeaway of: Two references are equal only if they…"
description: "\"“Two references are equal only if they reference the same object”\" — Eric Freeman"
image: "https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg"
---

#  Two references are equal only if they reference the same…

![“Two references are equal only if they reference the same object” quote by Eric Freeman](https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg)   [Download](https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg) [Open image](https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg)

> ““Two references are equal only if they reference the same object””

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

Equality of references depends on them pointing to the exact same memory location, not just having identical values.

**In simple terms:** References are equal only when they are the same object.

Key Takeaway

Check object identity, not just value equality.

Themes

programming software engineering object orientation

Mood

analytical technical

Type

educational technical

When to use this quote

- debugging
- code review
- teaching programming concepts

Key Concepts

reference equality memory address identity semantics

Questions to Reflect On

- How do you test for reference equality in your language?
- What pitfalls arise from confusing equality with identity?

A Different Perspective

Null references can cause errors if not handled.

★ ★ ★ ★ ★   No ratings yet

[Technology](https://sms4smile.com/quotes/about/technology/)

## Related quotes

> [“the constructor always has a prototype property. More”](https://sms4smile.com/quotes/eric-freeman/the-constructor-always-has-a-prototype-property-more/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“when you assign a value to a variable name that hasn’t been previously declared, it is treated as a new, global variable. So be…](https://sms4smile.com/quotes/eric-freeman/when-you-assign-a-value-to-a-variable-name-that-hasn-t-been/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Web Workers have a global function named importScripts that you can use to import one or more JavaScript files into your worker. To”](https://sms4smile.com/quotes/eric-freeman/web-workers-have-a-global-function-named-importscripts-that-you-can/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [There are definite reference points to older Depeche Mode records.](https://sms4smile.com/quotes/martin-gore/there-are-definite-reference-points-to-older-depeche-mode-records/)

[Martin Gore](https://sms4smile.com/quotes/author/martin-gore/)

> [During a color consultation, I like to reference food as a visual. Hot fudge and orange marmalade paint a clearer picture and helps prevent…](https://sms4smile.com/quotes/tabatha-coffey/during-a-color-consultation-i-like-to-reference-food-as-a-visual-hot/)

[Tabatha Coffey](https://sms4smile.com/quotes/author/tabatha-coffey/)

> [There was no Internet, not even many cookbooks except the old reference books. So we would sit down at night, a group of six…](https://sms4smile.com/quotes/daniel-boulud/there-was-no-internet-not-even-many-cookbooks-except-the-old/)

[Daniel Boulud](https://sms4smile.com/quotes/author/daniel-boulud/)

> [“I understand, given her track record, "I should use a first and last name-- maybe even the last four digits of their social security…](https://sms4smile.com/quotes/nicole-williams/i-understand-given-her-track-record-i-should-use-a-first-and-last/)

[Nicole Williams](https://sms4smile.com/quotes/author/nicole-williams/)

> [I'm not a cinephile. My films don't reference films. I'm more interested in rhythm and feeling.](https://sms4smile.com/quotes/miranda-july/i-m-not-a-cinephile-my-films-don-t-reference-films-i-m-more/)

[Miranda July](https://sms4smile.com/quotes/author/miranda-july/)

> [I'm never aiming to make a movie like someone else's movie, but in order to describe a movie to someone else who hasn't seen…](https://sms4smile.com/quotes/rob-zombie/i-m-never-aiming-to-make-a-movie-like-someone-else-s-movie-but-in/)

[Rob Zombie](https://sms4smile.com/quotes/author/rob-zombie/)

> [“On any given day, if I conduct a new search, I find additional posts referencing my name.”](https://sms4smile.com/quotes/ken-poirot/on-any-given-day-if-i-conduct-a-new-search-i-find-additional-posts/)

[Ken Poirot](https://sms4smile.com/quotes/author/ken-poirot/)

> [Drag went from being referential to being the reference, which is crazy.](https://sms4smile.com/quotes/bob-the-drag-queen/drag-went-from-being-referential-to-being-the-reference-which-is-crazy/)

[Bob the Drag Queen](https://sms4smile.com/quotes/author/bob-the-drag-queen/)

> [“I consider myself a synthetic thinker in a virtual domain therefore if I’m way off there is no solid foundation or reference for authentic…](https://sms4smile.com/quotes/carl-henegan/i-consider-myself-a-synthetic-thinker-in-a-virtual-domain-therefore/)

[Carl Henegan](https://sms4smile.com/quotes/author/carl-henegan/)

> [The memory of the Second World War hangs over Europe, an inescapable and irresistible point of reference. Historical parallels are usually misleading and dangerous.](https://sms4smile.com/quotes/antony-beevor/the-memory-of-the-second-world-war-hangs-over-europe-an-inescapable/)

[Antony Beevor](https://sms4smile.com/quotes/author/antony-beevor/)

> [“There is no shortcut for hard work that leads to effectiveness. You must stay disciplined because most of the work is behind the scenes.”](https://sms4smile.com/quotes/germany-kent/there-is-no-shortcut-for-hard-work-that-leads-to-effectiveness-you/)

[Germany Kent](https://sms4smile.com/quotes/author/germany-kent/)

> [The cross is to be our point of reference for every area of our lives all the time.](https://sms4smile.com/quotes/tony-evans/the-cross-is-to-be-our-point-of-reference-for-every-area-of-our-lives/)

[Tony Evans](https://sms4smile.com/quotes/author/tony-evans/)

## More by Eric Freeman

> [“When you delete a property, you’re not just deleting the value of the property, you’re deleting the property itself. And, if you try to…](https://sms4smile.com/quotes/eric-freeman/when-you-delete-a-property-you-re-not-just-deleting-the-value-of-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“the constructor always has a prototype property. More”](https://sms4smile.com/quotes/eric-freeman/the-constructor-always-has-a-prototype-property-more/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“when you assign a value to a variable name that hasn’t been previously declared, it is treated as a new, global variable. So be…](https://sms4smile.com/quotes/eric-freeman/when-you-assign-a-value-to-a-variable-name-that-hasn-t-been/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Web Workers have a global function named importScripts that you can use to import one or more JavaScript files into your worker. To”](https://sms4smile.com/quotes/eric-freeman/web-workers-have-a-global-function-named-importscripts-that-you-can/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“If the two values have different types, try to convert them into the same type and then compare them”](https://sms4smile.com/quotes/eric-freeman/if-the-two-values-have-different-types-try-to-convert-them-into-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Well, it’s a browser policy, and it says you can’t retrieve data from a domain that is different from the domain the page itself…](https://sms4smile.com/quotes/eric-freeman/well-it-s-a-browser-policy-and-it-says-you-can-t-retrieve-data-from-a/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Math is not a constructor, or even a function. It’s an object. As you know, Math is a built-in object that you can use…](https://sms4smile.com/quotes/eric-freeman/math-is-not-a-constructor-or-even-a-function-it-s-an-object-as-you/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“When you pass zero to setTimeout, you’re asking JavaScript to run your timeout handler as soon as it possibly can — and this leads…](https://sms4smile.com/quotes/eric-freeman/when-you-pass-zero-to-settimeout-you-re-asking-javascript-to-run-your/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“JavaScript doesn’t have a character type. So characters are returned as new strings containing one character.”](https://sms4smile.com/quotes/eric-freeman/javascript-doesn-t-have-a-character-type-so-characters-are-returned/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Closures are often used to capture state for event handlers.”](https://sms4smile.com/quotes/eric-freeman/closures-are-often-used-to-capture-state-for-event-handlers/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Lexical scope means that we can determine the scope of a variable by reading our code.”](https://sms4smile.com/quotes/eric-freeman/lexical-scope-means-that-we-can-determine-the-scope-of-a-variable-by/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Q: Q: You said getElementsByTagName returns a list. Do you mean an array? A: A: It returns an object that you can treat like…](https://sms4smile.com/quotes/eric-freeman/q-q-you-said-getelementsbytagname-returns-a-list-do-you-mean-an-array/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“the truth is JavaScript actually makes two passes over your page: in the first pass it reads all the function definitions, and in the…](https://sms4smile.com/quotes/eric-freeman/the-truth-is-javascript-actually-makes-two-passes-over-your-page-in/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“If you change any property in the prototype, it affects all the objects that inherit from that prototype, unless that object has overridden that…](https://sms4smile.com/quotes/eric-freeman/if-you-change-any-property-in-the-prototype-it-affects-all-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“methods in objects are properties too. They just happen to have a function assigned to them.”](https://sms4smile.com/quotes/eric-freeman/methods-in-objects-are-properties-too-they-just-happen-to-have-a/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

[Explore all 90 Eric Freeman quotes ](https://sms4smile.com/quotes/author/eric-freeman/)

## More Equal quotes

> [For many, the call to be a Christian can seem demanding, even overwhelming. But we need not be afraid or feel inadequate. The Savior…](https://sms4smile.com/quotes/robert-d-hales/for-many-the-call-to-be-a-christian-can-seem-demanding-even/)

[Robert D. Hales](https://sms4smile.com/quotes/author/robert-d-hales/)

> [Do not pray for tasks equal to your powers. Pray for powers equal to your tasks.](https://sms4smile.com/quotes/phillips-brooks/do-not-pray-for-tasks-equal-to-your-powers-pray-for-powers-equal-to/)

[Phillips Brooks](https://sms4smile.com/quotes/author/phillips-brooks/)

> [I do conscientiously and sincerely believe that the Order of Freemasonry, if not the greatest, is one of the greatest moral and political evils…](https://sms4smile.com/quotes/john-quincy-adams/i-do-conscientiously-and-sincerely-believe-that-the-order-of/)

[John Quincy Adams](https://sms4smile.com/quotes/author/john-quincy-adams/)

> [This, at last, was where things were as they ought to be. Everything was in its place -- the tree, the earth underneath, the…](https://sms4smile.com/quotes/jean-liedloff/this-at-last-was-where-things-were-as-they-ought-to-be-everything-was/)

[Jean Liedloff](https://sms4smile.com/quotes/author/jean-liedloff/)

> [Islam never differentiates between men and women as regards political rights and puts them on an equal footing. However, even if a woman is…](https://sms4smile.com/quotes/yusuf-al-qaradawi/islam-never-differentiates-between-men-and-women-as-regards-political/)

[Yusuf al-Qaradawi](https://sms4smile.com/quotes/author/yusuf-al-qaradawi/)

> [This brings me back to the image of Kafka standing before a fish in the Berlin aquarium, a fish on which his gaze fell…](https://sms4smile.com/quotes/jonathan-safran-foer/this-brings-me-back-to-the-image-of-kafka-standing-before-a-fish-in/)

[Jonathan Safran Foer](https://sms4smile.com/quotes/author/jonathan-safran-foer/)

> [Friendship, "the wine of life," should, like a well-stocked cellar, be continually renewed; and it is consolatory to think, that although we can seldom…](https://sms4smile.com/quotes/james-boswell/friendship-the-wine-of-life-should-like-a-well-stocked-cellar-be/)

[James Boswell](https://sms4smile.com/quotes/author/james-boswell/)

> [Jeff Chu's pilgrimage across America to discover his own place as a gay man in the Christian church as well as attitudes about being…](https://sms4smile.com/quotes/donna-freitas/jeff-chu-s-pilgrimage-across-america-to-discover-his-own-place-as-a/)

[Donna Freitas](https://sms4smile.com/quotes/author/donna-freitas/)

> [Only to have a grief equal to all these tears!](https://sms4smile.com/quotes/adrienne-rich/only-to-have-a-grief-equal-to-all-these-tears/)

[Adrienne Rich](https://sms4smile.com/quotes/author/adrienne-rich/)

> [My mom and dad had the relationship that I want, and they were teammates. They were always equal 50/50.](https://sms4smile.com/quotes/becca-kufrin/my-mom-and-dad-had-the-relationship-that-i-want-and-they-were/)

[Becca Kufrin](https://sms4smile.com/quotes/author/becca-kufrin/)

> [Faith and unfaith can ne'er be equal powers; Unfaith is aught is want of faith in all.](https://sms4smile.com/quotes/alfred-lord-tennyson/faith-and-unfaith-can-ne-er-be-equal-powers-unfaith-is-aught-is-want/)

[Alfred Lord Tennyson](https://sms4smile.com/quotes/author/alfred-lord-tennyson/)

> [If it is true that there is always more than one way of construing a text, it is not true that all interpretations are…](https://sms4smile.com/quotes/paul-ricoeur/if-it-is-true-that-there-is-always-more-than-one-way-of-construing-a/)

[Paul Ricoeur](https://sms4smile.com/quotes/author/paul-ricoeur/)

> [There is usually no dreamer so unworldly as the anthologist. He wanders in a vast garden, lost in wonder, unable to decide often between…](https://sms4smile.com/quotes/mary-webb/there-is-usually-no-dreamer-so-unworldly-as-the-anthologist-he/)

[Mary Webb](https://sms4smile.com/quotes/author/mary-webb/)

> [I can tell you this. It is not going to be evenly constituted and when she was Speaker Pelosi, she certainly showed no interests…](https://sms4smile.com/quotes/trey-gowdy/i-can-tell-you-this-it-is-not-going-to-be-evenly-constituted-and-when/)

[Trey Gowdy](https://sms4smile.com/quotes/author/trey-gowdy/)

> [It concerns me when people frame the conversation about equal pay about the entertainment business. I don't want the wage gap issue to be…](https://sms4smile.com/quotes/patricia-arquette/it-concerns-me-when-people-frame-the-conversation-about-equal-pay/)

[Patricia Arquette](https://sms4smile.com/quotes/author/patricia-arquette/)

Browse all 4,126 Equal quotes

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "“Two references are equal only if they reference the same object”",
            "creator": {
                "@type": "Person",
                "name": "Eric Freeman"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/eric-freeman/two-references-are-equal-only-if-they-reference-the-same-object/",
            "about": {
                "@type": "Thing",
                "name": "Equal"
            },
            "@id": "https://sms4smile.com/quotes/eric-freeman/two-references-are-equal-only-if-they-reference-the-same-object/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg",
                "contentUrl": "https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg",
                "url": "https://sms4smile.com/quotes/i/abd/eric-freeman-7573_equal_two-references-are-equal-only-if-they-re_2290380.jpg",
                "width": 1080,
                "height": 1080,
                "caption": "“Two references are equal only if they reference the same object” — Eric Freeman",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Eric Freeman",
                    "item": "https://sms4smile.com/quotes/author/eric-freeman/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "“Two references are equal only if...",
                    "item": "https://sms4smile.com/quotes/eric-freeman/two-references-are-equal-only-if-they-reference-the-same-object/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/eric-freeman/two-references-are-equal-only-if-they-reference-the-same-object/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
