Writing to Java Script Console PRO

We can easily track our code in Java Script by writing text messages to the Java Script console. The following code sample shows how to do it.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <script type="text/javascript">
        var sum = 0;
        for(i=1; i<=10; i++)
        {
            sum+=i;
            console.log("i="+i);
            console.log("sum="+sum);
        }
        document.write("sum="+sum);
    </script>
</head>
<body>

</body>
</html>

The following video clip explains the code sample When using Firefox there is a need in installing the Firebug extension.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences