Share the short summary of errors in the pipeline script for debugging.

Source: Internet
Author: User
I will share the summary of the simple errors in the pipeline script. It is my notes during the learning process. I will share the summary of the simple errors in the pipeline script and the summary of errors in my notes during the learning process.
  1. When judging a statement, if (x = 0) and (x = 0) and (x = 0) are different.
    X = 0 is a negative value. 0 is flase. If x = 10, it is true.
    X = 0 is determined, but it will automatically convert the Type x = '10' and x = 10.
    X = 10 must be of the same type before judgment

  2. Addition and join operators are different.
    X = '10' y = 5;
    X + y equals 105 at this time;

  3. String Branch

     var x = "Hello World!";

    In this case, the Branch will report an error.

     var x = "HelloWorld!";

    This is correct
    You can also add a backslash.

     var x = "Hello\ World!";
  4. Semi-colon forgetting or writing an error

  5. No return value for the line feed result after return

  6. The array uses the name for indexing. The array can only use numbers for indexing.

  7. An array object cannot end with a comma

  8. Undefined is not Null

  9. Block Scope

    JavaScript Error

    Various Errors may occur when the JavaScript engine executes JavaScript code.
    It may be a syntax error. It is usually a code error or a typo caused by a programmer.
    It may be a spelling mistake or a lack of functionality in the language (possibly due to browser differences ).
    The error may be caused by incorrect output from the server or user.
    Of course, it may also be caused by many other unpredictable factors.

    Throw error in JavaScript

    When an error occurs, when something goes wrong, the JavaScript engine usually stops and generates an error message.
    The technical term used to describe this situation is: JavaScriptThrowAn error occurred.

    JavaScript try and catch

    TryThe statement allows us to define the code block for an error test during execution.
    CatchThe statement allows us to define the code block to be executed when an error occurs in the try code block.
    JavaScript statementsTryAndCatchIt appears in pairs.

    Try {

    // Run the code here

    } Catch (err ){

    // Handle errors here

    }
    Chestnuts

    Ar txt = "";
    Function message ()
    {

    Try {adddlert ("Welcome guest! ");} Catch (err) {txt =" An error occurred on this page. \ N "; txt + =" error Description: "+ err. message +" \ n "; txt + =" click "OK" to continue. \ N "; alert (txt );}

    }
    Message ();

Syntax

 throw *exception*

An exception can be a JavaScript string, number, logical value, or object.

                
     Js exception                
Judgment

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.