What is console.log?

前端 未结 22 2712
面向向阳花
面向向阳花 2020-11-22 00:41

What is the use of console.log?

Please explain how to use it in JavaScript, with a code example.

22条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 01:27

    If your browser supports debugging, you can use the console.log() method to display JavaScript values.

    Activate debugging in your browser with F12, and select "Console" in the debugger menu.

    Console in JavaScript. Try to fix, or "debug," a non-functioning JavaScript program, and practice using the console.log() command. There are shortcuts that is going to help you to access to the JavaScript console, based on the browser that you are using:

    Chrome Console Keyboard Shortcuts

    Windows: Ctrl + Shift + J
    Mac: Cmd + Option + J

    Firefox Console Keyboard Shortcuts

    Windows: Ctrl + Shift + K
    Mac: Cmd + Option + K

    Internet Explorer Console Keyboard Shortcuts

    F12 key

    Safari Console Keyboard Shortcuts

    Cmd + Option + C

提交回复
热议问题