here is my simple dart code.
import 'dart:io';
main(){
print("Hello World");
stdout.writeln("Another Hello World");
}
output:
Hello World //Prints newline by default.
Another Hello World //Also print newline after this.
If both functions print a newline after printing, then what is the difference between both of them.
On the DartVM the behaviours are the same. But when Dart code runs in browser you cannot use stdout. dart:io library can not be used in Browser-based applications. print been part of the core library it can be used everywhere.
A little difference (also on VM) is that print can be overriden with Zone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With