Created
June 26, 2019 11:34
-
-
Save uguisu-an/cd4b2e0c169cf0825f88ca402a8747d6 to your computer and use it in GitHub Desktop.
isEqualの例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require("lodash"); | |
const a = [1, 2, 3]; | |
console.info([...a] == [...a]); //=> false | |
console.info(_.isEqual([...a], [...a])); //=> true | |
const o = { | |
id: 1, | |
name: "John Doe" | |
}; | |
console.info({ ...o } == { ...o }); //=> false | |
console.info(_.isEqual({ ...o }, { ...o })); //=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment