Dante
Dante

Reputation: 537

console.log() vs console.clear() in Chrome Developer tools

How come console.clear() works by just typing clear() in the console but you can't do stuff like log("Hello") in the console?

You have to do console.log("Hello") to make it work. Why is this?

Upvotes: 0

Views: 75

Answers (1)

Daniel A. White
Daniel A. White

Reputation: 190943

clear is defined by the console itself. Notice that the snip below fails. it isn't the same as console.clear.

console.log(clear);

Upvotes: 1

Related Questions