Last active
February 9, 2025 19:38
-
-
Save kmdshi/75dc871b958b3268b42985773df22ff9 to your computer and use it in GitHub Desktop.
dart comparisons
This file contains 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
void main() { | |
var a = [1, 2, 3]; | |
var b = [1, 2, 3]; | |
var c = a; // одна и та же ссылка в памяти | |
print(a == b); // false | |
print(a.hashCode == b.hashCode); // false | |
print(identical(a, b)); // false | |
print(a == c); // true | |
print(a.hashCode == c.hashCode); // true | |
print(identical(a, c)); // true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment