Last active
April 20, 2021 08:06
-
-
Save davidmigloz/10a7d420197368ae53f6145cbab52259 to your computer and use it in GitHub Desktop.
Dart vs Kotlin: relational operators
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
import 'package:collection/collection.dart'; | |
void main() { | |
var gt = 5 > 4; // true | |
var lt = 5 < 4; // false | |
var list1 = [1, 2, 3]; | |
var list2 = [1, 2, 3]; | |
var equality = list1 == list2; // false | |
var identity = identical(list1, list2); // false | |
var collectionEquality = IterableEquality().equals(list1, list2); // true | |
} |
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
fun main() { | |
var gt = 5 > 4 // true | |
var lt = 5 < 4 // false | |
var list1 = listOf(1, 2, 3) | |
var list2 = listOf(1, 2, 3) | |
var equality = list1 == list2 // true | |
var identity = list1 === list2 // false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment