Snap! Console Blocks (Part 2)

The log variable should have all the console data, if that's what you mean.

I mean like in developer tools

You don't.

Wait, I got the console.

How to turn an object into text?

In JS, you use v.toString() assuming it's called v

I got it working with return console.toString.

and what did that say? [object Object]? (this is a rhetorical question; it did.)

I got [object Object]:

Uh oh:


It is returning the javascript I just ran.

You didn't put parens.

No, it's not. It's also not returning the contents of the console.
When you put brackets () after a function, it runs the function and gets the result. If the brackets are removed, it will instead tell you what the function is. The latter, in this case.
The console's toString function is inherited from basic JavaScript, so it has the same name but says [native code] after.

You can get the same thing with return console

But then it returns the console itself, not its string form.

So how do we turn this into text?

You don't, like I said before. It's not possible to see the contents of the console.

Then how can other websites do that?

They can't, I don't know what you're talking about.

I think he means "how do browsers get the contents?".

Oh.
@joecooldoo Chrome's console (and presumably other browsers) doesn't run on JavaScript. JavaScript exists outside of the console but is given a few ways to access it (such as console.log).