Comments in JavaScript Normally in JavaScript, the comments are treated as text between //. Multiple line comments are treated as the text between /* and */ Comments are required to make code understandable, we don’t have to think we are not only the coder, programmer & expert. If another engineer or developer check any part […]
Read MoreVariables and Naming Rules JavaScript variables can be used to hold values [e.g.: (x=10) or expression (a=b+c)]. Variable can have short names (like x and y) or more descriptive names (age, sum total volume) JavaScript variables are declared using the keyword var. Rule For Naming Variables Variable names must begin with a letter. Variable names […]
Read MoreJavaScript can be written inside the both <head> section and <body> section. Sometimes we need to write the JavaScript code in both sections to better understand or calling the different functions. While writing JavaScript code <head> and <body> section we have to use <script> tag for both. Here you can see an example where I […]
Read MoreJavaScript code can be placed inside the <body> and </body> tag of the HTML document. Using JavaScript code in the body section will be better for the loading of the web page or HTML document. We can put JavaScript code in the <head> section also but that will take more time to load the webpage. […]
Read More