javascript program code example

Example 1: javascript code

html>
<head>
  <title>Multiplication Table</title>
  <script type="text/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;

Example 2: JavaScript

Javascript is a very high-level coding language used in HTML and many of your 
favorite websites, Couldn't be made without JS. Javascript can be used 
Front-Back end and JavaScript is popularly known for Discord.js and 
react.js.

Example:

const discord = require = ('discord.js');

When using js its always good to remember to finish off your code with ";"

Example 3: javascript code

function getIntoAnArgument() {
    var args = arguments.slice();
    args.forEach(function(arg) {
        console.log(arg);
    });
}

Example 4: javascript

let str = 'Hello World';
console.log(str);

Example 5: js examples

To create a new primitive symbol, you write Symbol() with an optional string as its description:

Examples:

let sym1 = Symbol()
let sym2 = Symbol('foo')
let sym3 = Symbol('foo')

Tags:

Java Example