Skip to content

Instantly share code, notes, and snippets.

@kmdshi
Last active February 9, 2025 19:38
Show Gist options
  • Save kmdshi/75dc871b958b3268b42985773df22ff9 to your computer and use it in GitHub Desktop.
Save kmdshi/75dc871b958b3268b42985773df22ff9 to your computer and use it in GitHub Desktop.
dart comparisons
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