How can I print multiple objects to console.log with dart? How can I print multiple objects to console.log with dart? dart dart

How can I print multiple objects to console.log with dart?


What about: ?

print('The values are: ${[x, y, z]}')

or

print('The values are: $x, $y, $z')

or

['The values are:', x, y, z].forEach(print);


In Dart, you can import dart:html which gives you access to the window.console. Unfortunately, its log method can only take one argument. You can wrap your objects in a list though:

import 'dart:html';var x = 1var y = 'cat'var z = {color: 'blue'}window.console.log([x, y, z]);