3

Syntax suggestions in Chrome console show that console.dir has options parameter:

console.dir

But it's not documented, and options from Node.js implementation are irrelevant in this context.

Is the mention of options parameter a mistake or something that didn't arrive yet to Chrome?

Estus Flask
  • 206,104
  • 70
  • 425
  • 565
  • 1
    perhaps you could dive down the rabbit hole starting at https://console.spec.whatwg.org/#dir - it links to https://console.spec.whatwg.org/#printer then I lost interest – Bravo Jul 07 '21 at 06:01
  • @Bravo I think you might have given up right before you found the answer: "*If the options object is passed, and is not undefined or null, implementations may use options to apply implementation-specific formatting to the elements in args.*". Admittedly, it seems super boring. Seems like `console.dir()` should be able to accept `options` but whether and how it uses them is implementation dependent. Perhaps Chrome is merely showing the signature per the spec but doesn't use `options` at all. – VLAZ Jul 07 '21 at 06:05
  • @VLAZ I did read that, I gave up because clearly I'd have to read Chrome documentation for Chrome specifics. Have you ever read any Chrome documentation? Even they gave up a couple of years ago and stated (somewhere) *Go use MDN docs, they're much better*, But MDN docs don't show ?options as even a chrome only thing. But, MDN document `MIDIAccess` which doesn't exist in Firefox, so you can't accuse MDN of being slack – Bravo Jul 07 '21 at 06:08
  • @Bravo Thanks, I see where it comes from. It looks like it just follows the interface indeed. I've probed it through a proxy and it seems that it totally ignores options object. – Estus Flask Jul 14 '21 at 18:40

1 Answers1

1

State of things in April 2023 seems to be: this is a placeholder. https://developer.chrome.com/docs/devtools/console/utilities/#dir-function

And since MDN doesn't mention an options parameter, I'd assume that Firefox doesnt's support dir options either.

Rolf
  • 730
  • 6
  • 14