whatwg / console

Console Standard
https://console.spec.whatwg.org/
Other
274 stars 70 forks source link

add `console.log` function to window, so we can use `log` direct! #221

Closed zhangenming closed 1 year ago

zhangenming commented 1 year ago

now, we have window.dir, So why can't we have it. thanks

domfarolino commented 1 year ago

Interesting, do you know where dir() is defined in the spec? It seems like a non-standard API that is not available to Safari or Firefox.

zhangenming commented 1 year ago

https://developer.chrome.com/docs/devtools/console/utilities/#dir-function

terinjokes commented 1 year ago

That's not a property on window, but a custom shortcut implemented inside of Chrome's Developer Tools.

zhangenming commented 1 year ago

Yes, this variable only exists when Chrome's Developer Tools is open. but console.log is such a common method, may you can provide a simpler one with fewer keystrokes for easy input?like log. tks

domfarolino commented 1 year ago

I feel pretty certain that this could be solved by some basic JS that aliases log to console.log etc. I don't think this really needs a lot of platform buy-in. I'm going to close this, but thanks for filing.