enter:
> Node
>
If you get a prompt and the system does not warn you that "Sorry, there is no such command", congratulations, the installation is successful. If you still want to observe the directory structure of nodejs, you will also find that it is much simpler to upload a node.exe file. Is there anything simpler than this?
Ah? Do you have an npm. cmd batch file and node_modules folder? That, we can ignore it for the moment. You can delete them without affecting the use of node.
Node. js console. log method instructions, node. jsconsole. log
Method description:
Print characters to the standard output stream and end with a line break.
Syntax:
Copy codeThe Code is as follows:Console. log ([data], [...])
Receiving parameters:
Console. log accepts several parameters. If there is only one parameter, the string format of this parameter i
function is similar to cmd and is very convenient ..
Exercises after class: (Press F12 to open the console now)1. Check the function source code recommended for this function at the bottom of the article. (Of course, you can click here to recommend it. I didn't block you. O (worker _ worker) o)2. Locate the file where the function is located. (The climax is coming)3. Modify the function to make it invalid. (In fact, it is simple global modification d
Js console output method (detailed description) console. log (object [, object,...])
Output a message on the console. If multiple parameters exist, the output parameters are separated by spaces.
The first parameter can be a string that contains the formatted placeholder output, for example:
terminal, first in the terminal you want to see the log input:$ ttyYou can get the terminal number, for example:/dev/ttys003Then another terminal uses:$ geth console 2>> /dev/ttys003Start Geth, which is the log output to another terminal.If you do not want to see the log, you can redirect to an empty terminal:$ geth console 2>> /dev/nullLog level ControlYou can use --verbosity to control the log level, and
to the location where the code is called.
Console.assert (expression[, Object, ...])
Tests whether an expression expression is true. If not true, a message is written at the console and an exception is thrown
Console.dir (object)
Outputting all the properties of an object in a list is a bit like the way you look at the Dom window.
Console.dirxml (node)
Output an XML source code for an HTML or XML element. Similar to what you see in the HTML win
, has a minimum run time of 0.123 milliseconds, a maximum of 0.284 milliseconds, an average of 0.139 milliseconds, and FUNCB () runs 1 times and takes 1.229ms milliseconds.In addition to using the Console.profile () method, Firebug also provides an "overview" (Profiler) button. The first time you click on the button, "profiling" starts, you can do something about the Web page (such as an AJAX operation), and then click the button for the second time, "profiling" ends, and all the operations that
total of 2.656 milliseconds. Where Funca () runs 10 times, takes 1.391 milliseconds, has a minimum run time of 0.123 milliseconds, a maximum of 0.284 milliseconds, an average of 0.139 milliseconds, and FUNCB () runs 1 times and takes 1.229ms milliseconds.In addition to using the Console.profile () method, Firebug also provides an "overview" (Profiler) Button. The first time you click on the button, "profiling" starts, you can do something about the Web page (such as an AJAX operation), and then
total of 2.656 milliseconds. where Funca () runs 10 times, takes 1.391 milliseconds, has a minimum run time of 0.123 milliseconds, a maximum of 0.284 milliseconds, an average of 0.139 milliseconds, and FUNCB () runs 1 times and takes 1.229ms milliseconds.In addition to using the Console.profile () method, Firebug also provides an "overview" (Profiler) button. The first time you click on the button, "profiling" starts, you can do something about the Web page (such as an AJAX operation), and then
Just read about the JS Blog when found that this method is very fun, I have a cool.1 When loaded, the console displays the following: Can see, different nature of the information in front of the different icons, and each message has a hyperlink behind, click to jump to the corresponding line of the source page.Second, placeholder You can use the printf-style placeholder for the top 5 methods of t
Turn from:Nine console commands to make JS debugging easierI. Commands to display information
123456789101112131415
"Content-Type" content="text/html; charset=utf-8"/>
The most common is the console.log.Two: PlaceholderConsole The above concentration supports printf placeholder format, supported placeholders are: characters (%s), integers (%d or%i), floating-point numbers (%f), and
When debugging js, we can use alert to display information and Debug programs. The alert pop-up window will interrupt the program. If you want to display information in a loop, you will be exhausted by clicking close window. In addition, the alert Display object is always displayed as [object]. Although the self-written log can display some object information, many functions do not support the console.
[1]
"); // Select Body Node13. Copy copies the contents obtained from the console to the Clipboard by this commandcopy (document.body); Copy bodycopy (document.getElementById ("info")); Copy the node of an ID element14. The $_ command returns the results of the most recent expression execution, $0-$4 represents the last 5 DOM nodes you have selectedXV, using the console output
" /> Head> Body> DivID= "Info"> H3>My blog: http://www.cnblogs.com/chaoran/H3> Div> Scripttype= "Text/javascript"> varInfo=document.getElementById ('Info'); Console.dirxml (info); Script> Body> HTML>Iv. Judging if the variable is trueConsole.assert () is used to determine whether an expression or variable is true. If the result is no, a corresponding message is output in the console and an
Because to get an automatic landing tool for a webpage, it is necessary to use JS for the elements of this page to select and manipulate, complex JS selection if directly in the mind is prone to error, and once the error is not good to judge the cause of the error.The console feature of the developer tools in the browser provides us with a feature that is as conv
=document.getElementById ('Info'); - Console.dirxml (info); the Script> - Body> - HTML>Effect:Vi. Judging if the variable is trueConsole.assert () is used to determine whether an expression or variable is true. If the result is no, a corresponding message is output in the console and an exception is thrown.1 1 is a value of 0, is true, and the second is false, displaying an error message on the consoleTracing the call trajectory of the fu
to open the console directly)1. View the article below recommend this function called the function source code (of course, you point to recommend also can Oh, I did not stop you.) O (∩_∩) o)2. Navigate to the location of the file where the function resides. (The climax is coming)3. Modify the function to invalidate it. (In fact, is simply a global modification debugging.) )
Finally, if what is wrong, or understand, or progress to keep up and so on a
a function. function add (A, b) {console.trace (); return a + b;} var x = add3 (1, 1 function Add3 (A, b) { return Add2 (A, b);} function Add2 (A, b) { return Add1 (A, b);} function Add1 (A, b) { return add (a, b);} After the run, add() the call trajectory is displayed, from top to bottom, and, add() add1() add2() add3() .Chronograph functionconsole.time()And console.timeEnd() , used to display the run time of the code.Console.time (' Timer one '); for (var i = 0; i ) {
This article mainly introduces the JS Debugging Tool console command in detail, the need for friends can refer to the nextI. Commands to display informationCopy CodeThe code is as follows:The most common is the console.log.Two: Placeholder console The above concentration supports printf placeholder format, supported placeholders are: characters (%s), integers (%d
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.