JavaScript tutorial

JavaScript, often abbreviated as JS, is a high-level, just-in-time compiled, object-oriented programming language that conforms to the ECMAScript specification. JavaScript has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.

Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. JavaScript enables interactive web pages and is an essential part of web applications. The vast majority of websites use it, and major web browsers have a dedicated JavaScript engine to execute it.

JavaScript was designed for client-side in browsers, but now can be used in other types applications.

There are other implementation of ECMAScript like ActionScript, V8, SpiderMonkey etc. But most popular is JavaScript.

var rows = prompt("How many rows for your multiplication table?");
    var cols = prompt("How many columns for your multiplication table?");
    
    if(rows == "" || rows == null)
   		 rows = 10;

    if(cols== "" || cols== null)
   		 cols = 10;

    createTable(rows, cols);

    function createTable(rows, cols) {
      var j=1;
      var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
    
      for(i=1;i<=rows;i++) {
         output = output + "<tr>";
         
         while(j<=cols) {
             output = output + "<td>" + i*j + "</td>";
              j = j+1;
   	 }
          
         output = output + "</tr>";
         j = 1;
       }
   
       output = output + "</table>";
       document.write(output);
    }