Page 139 - JavaScript
P. 139

•  break statement
            •  return statement
            •  throw statement


        Examples:

        When the end of the input stream of tokens is encountered and the parser is unable to parse the
        input token stream as a single complete Program, then a semicolon is automatically inserted at the
        end of the input stream.


         a = b
         ++c
         // is transformed to:
         a = b;
         ++c;



         x
         ++
         y
         // is transformed to:
         x;
         ++y;


        Array indexing/literals


         console.log("Hello, World")
         [1,2,3].join()
         // is transformed to:
         console.log("Hello, World")[(1, 2, 3)].join();


        Return statement:


         return
           "something";
         // is transformed to
         return;
           "something";


        Avoid semicolon insertion on return statements


        The JavaScript coding convention is to place the starting bracket of blocks on the same line of
        their declaration:


         if (...) {

         }

         function (a, b, ...) {

         }


        Instead of in the next line:



        https://riptutorial.com/                                                                               96
   134   135   136   137   138   139   140   141   142   143   144