"Basic syntax for JavaScript"

Source: Internet
Author: User

"The basic syntax of JavaScript"1.javascript Outputa command issued by a JavaScript statement to the browser. The purpose of the statement is to tell the browser what to do. <script>document.write ("Hello world!");</script>Insert, output. document.getElementById ("pid"). Innerhtml= "hahaha";writing content to a document through document.write ()writing content to the console via Console.log ()2. Semicolonthe split between statements is a semicolon (;) .Note: Semicolons are optional, and sometimes you see that they are not separated by semicolons. 3.JavaScript Code:execute sequentially in the order in which they appear in the HTML file4. Identifiers:JavaScript identifiers must start with a letter, underscore, or dollar signJavaScript keyword5.JavaScript sensitive to caseJavaScript is also sensitive to casing. 6. SpacesJavaScript ignores extra spaces7. Line Code Wrappingyou can't wrap between words.8. Reserved wordsNotessingle-line comment//Multi-line Comment/**/errors in JavaScript

1. Syntax error: Debugging through the console

2. Logic error: Debug via alert ()

"Basic syntax for JavaScript"

Related Article

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.