1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 <Scripttype= "Text/javascript">7 8 /*9 * Our program is composed of a single statementTen * Statements are executed in a single line from the top-down order One * A * In JS, you can use {} to group statements. - * Statements in the same {} We call a set of statements, - * They are either executed, or not executed, the * A statement in {} We also call a block of code - * You don't have to write the code behind the Block . - * - * JS code block, only has the function of grouping, no other use + * The contents of the code block content, which is completely visible externally - */ + A //------------------------------------------------------------------------------ at - { - vara= Ten; - Alert ("Hello"); - Console.log ("Hello"); - document.write ("Statement"); in } - to //The contents of the code block contents, which are completely visible externally + Console.log ("A ="+a); //Ten - the * $ Panax Notoginseng </Script> - </Head> the <Body> + </Body> A </HTML>
JS Base _ code block