You use ==
or ===
:
var thesame = obj1===obj2;
If both operands are objects, then JavaScript compares internal
references which are equal when operands refer to the same object in
memory.
More Related Contents:
- Which equals operator (== vs ===) should be used in JavaScript comparisons?
- What is the difference between the `=` and `==` operators and what is `===`? (Single, double, and triple equals)
- Why doesn’t my equality comparison using = (a single equals) work correctly? [duplicate]
- How do I check for null values in JavaScript?
- Why `null >= 0 && null
- Checking if two Dates have the same date info
- JavaScript Date Comparisons Don’t Equal [duplicate]
- How does JS type coercion work?
- Why does (“foo” === new String(“foo”)) evaluate to false in JavaScript?
- What is the difference between the = and == operators, and what is ===?
- Javascript – deepEqual Comparison
- Determining Date Equality in Javascript
- Can I define custom operator overloads in Javascript? [duplicate]
- How do I check if an array includes a value in JavaScript?
- How do you get a timestamp in JavaScript?
- Why do you need to invoke an anonymous function on the same line?
- Full-screen iframe with a height of 100%
- AngularJS – How to use $routeParams in generating the templateUrl?
- How to delete document from firestore using where clause
- Watch multiple $scope attributes
- Pass Array from MVC to javascript?
- How can I preserve lexical scope in TypeScript with a callback function
- WordPress path url in js script file
- ReferenceError: variable is not defined
- How to extract text from a PDF in JavaScript
- Template literals like ‘some ${string}’ or “some ${string}” are not working
- How to know when browser finish to process an image after loading it?
- Chrome Extension “Refused to load the script because it violates the following Content Security Policy directive”
- Reload an HTML page just once using JavaScript
- updateProfile is not a function (Firebase)