Skip to content

Can console.log(...) support multiple params? #44168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chenenyu opened this issue Nov 12, 2020 · 4 comments
Closed

Can console.log(...) support multiple params? #44168

chenenyu opened this issue Nov 12, 2020 · 4 comments
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.

Comments

@chenenyu
Copy link

No description provided.

@Silentdoer
Copy link

dart has console.log(..) ?

@chenenyu
Copy link
Author

@Silentdoer dart:html

@keertip keertip added the area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. label Nov 12, 2020
@kevmoo
Copy link
Member

kevmoo commented Nov 12, 2020

We'll likely wait until we have dart-lang/language#1014 – same for print

@sigmundch
Copy link
Member

Thanks for filing the issue.

Until this is addressed, note you can use JS-interop to circumvent the problem:

@JS()
library foo;
import 'package:js/js.dart'
...

@JS('window.console')
external myConsole(arg1, arg2, arg3);

...
main() {
  myConsole(a, b, c);
}

or:

import 'dart:js_util' as js_util;
import 'dart:html';
...
main() {
  js_util.callMethod(window, 'console', [a, b, c]);
}

I was able to find a very similar and old request here: #19977, so I'll close this as a duplicate of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
Projects
None yet
Development

No branches or pull requests

5 participants