The Console displays the result while you type, regardless of whether your JavaScript is correct, and regardless of whether a valid result exists. The Eager evaluation feature helps you write valid JavaScript. The Console immediately displays the result 4 on the next line while you type. If necessary, click in DevTools to give it focus, and then press Esc to open the Console.Ĭlick in the Console, and then type 2+2, without pressing Enter. Or, press Ctrl+ Shift+ J (Windows, Linux) or Command+ Option+ J (macOS), to directly open the DevTools console. Right-click in a webpage and then select Inspect. To enter JavaScript statements and expressions interactively in the Console: Prints out the result of your expression.Reads the JavaScript that you type into it.REPL stands for Read, Evaluate, Print, and Loop. This is possible because the Console tool in DevTools is a REPL environment. You can enter any JavaScript expression, statement, or code snippet in the Console, and it runs immediately and interactively as you type.
0 Comments
Leave a Reply. |