JavaScript Guideline

In this example I am going to explain about JavaScript Guideline.
  • 1888

JavaScript Guideline

JavaScript is an case sensitive language it means capital letter are different from small letter. So it is vary necessary for different between capital and small at the time of writing JavaScript code. JavaScript also ignore extra space. we can add extra space for making JavaScript more readable. In JavaScript we can not break up a code line with in text string with a back space.

Example

In this Example "Myfunction()" and "myfunction()" can not be same.

<html>

<head>

    <script type="text/javascript">

        function Myfunction() {

            //Your Statement

        }

        function myfunction() {

            //Your statement

        }

    </script>

</head>

<body>

    <button type="button" onclick="Myfunction()">

        click me</button>

    <button type="button" onclick="myfunction()">

        Click me</button>

</body>

</html>

JavaScript ignore to white space

<html>

<head>

    <script type="text/jscript">

        function myfun() {

            var str = "hello";

            var str = "hello";

 

        }

    </script>

</head>

</html>

 

In JavaScript we can not break up line as this example

 

<html>

<head>

    <script type="text/jscript">

        function myfun() {

            var str = "hello";

 

 

            document.write /

            (str)

        }

    </script>

</head>

</html>

Further Readings

You may also want to read these related articles: here
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2020 DotNetHeaven. All rights reserved.