Reputation: 537
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
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