mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-04 22:07:52 +02:00
add dart null aware operator
This commit is contained in:
@@ -659,6 +659,11 @@ example33() {
|
|||||||
findVolume33(10,20);//valid
|
findVolume33(10,20);//valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Dart has also added feature such as Null aware operators
|
||||||
|
var isBool = true;
|
||||||
|
var hasString = isBool ?? "default String";
|
||||||
|
var hasValue ??= "default Value";
|
||||||
|
|
||||||
/// Programs have only one entry point in the main function.
|
/// Programs have only one entry point in the main function.
|
||||||
/// Nothing is expected to be executed on the outer scope before a program
|
/// Nothing is expected to be executed on the outer scope before a program
|
||||||
/// starts running with what's in its main function.
|
/// starts running with what's in its main function.
|
||||||
|
Reference in New Issue
Block a user