"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"