how to code in javascript code example
Example 1: how to create js code
<!--just open a file with the ending of ".js"
example: myFirstJS.js
an other option is to write this sentence on HTML document:
-->
<script type="text/javascript">
</script>
Example 2: 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 3: how to code javascript
console.log("Hello World!");
Example 4: javascript learning
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/