Writing a js console