JS: How to Use Browser Console

By Xah Lee. Date: . Last updated: .

A easy way to try JavaScript code is to use browser's JavaScript console, usually under a menu named Developer Tool.

Google Chrome Browser

On Google Chrome browser for Windows: Press F12 or Ctrl+Shift+i to toggle JavaScript console.

On macOS ⌘ command+⌥ option+i

chrome js console 2019-06-12 88y88
Google Chrome browser JavaScript console 2019-06-12


firefox console 2018-08-25 b4dc7
Firefox console 2018-08-25


In Safari, first turn on Develop menu.

safari turn on web console 2017 09 24 85788
in Safari, to turn on Develop menu, go to Safari Preferences, Advanced tab.

then press ⌘ command+⌥ option+i to toggle the JavaScript console.

sarari web dev console 2019-06-11 dnryw
Sarari web dev console 2019-06-11
BUY ΣJS JavaScript in Depth