Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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;
Comment

JavaScript code

//The shift() method removes the first array element and "shifts" all other elements to a lower index.

const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();

// The shift() method returns the value that was "shifted out": >> Banana

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

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">
//write here your code
</script>
Comment

code javascript

<!-- on charge p5.js 
************************************************* 
attention src="//…" ne marchera que sur un serveur et bascule en https ou http ! 
sans serveur src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.10/p5.js" 
************************************************* -->
<script src="//cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.10/p5.js"></script>
<script>
Comment

code JavaScript

//The length property provides an easy way to append a new element to an array:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits[fruits.length] = "Kiwi"
// >>  ["Banana", "Orange", "Apple", "Mango" , "Kiwi"]


//if you find this answer is useful ,
//upvote ⇑⇑ , so  the others can benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

code JavaScript

//The unshift() method adds a new element to an array (at the beginning), and "unshifts" older elements:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.unshift("Lemon");
//The unshift() method returns the new array length : >> 5


/*if you find this answer is useful ,
upvote ⇑⇑ , so  the others can benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)*/
Comment

code javascript

<!-- on charge p5.js 
************************************************* 
attention src="//…" ne marchera que sur un serveur et bascule en https ou http ! 
sans serveur src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.10/p5.js" 
************************************************* -->
<script src="//cdnjs.coudflare.com/ajax/libs/p5.js/0.5.10/p5.js"></script>
<script>
  var d1 = random(1, 7);
  var d2 = random(1, 7);
  var d3 = random(1, 7);
  var d4 = random(1, 7);
</script>
Comment

code javascript

<!-- on charge p5.js 
************************************************* 
attention src="//…" ne marchera que sur un serveur et bascule en https ou http ! 
sans serveur src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.10/p5.js" 
************************************************* -->
<script src="//cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.10/p5.js"></script>
<script>
  var d1 = random(1, 7);
  var d2 = random(1, 7);
  var d3 = random(1, 7);
  var d4 = random(1, 7);
</script>
Comment

js code

js basic code example
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript int to string 
Javascript :: hasownproperty javascript 
Javascript :: jquery plugin for searchable dropdown 
Javascript :: javscript ajax request gmt header 
Javascript :: json.stringify pretty 
Javascript :: react native gif dont work 
Javascript :: get all child element of class javascript 
Javascript :: java hashmap get array of keys 
Javascript :: Prevent default event behavior 
Javascript :: Saber si un elemento existe en el DOM 
Javascript :: react form hook npm 
Javascript :: or operator javascript 
Javascript :: get file extension file upload control in javascript 
Javascript :: useref in functional component 
Javascript :: anonymous function javascript 
Javascript :: js get each pair of values from an array of objects 
Javascript :: projection in mongodb 
Javascript :: truthy and falsy values in javascript 
Javascript :: how to make bootstrap navbar to change on scroll 
Javascript :: jquery templates 
Javascript :: js replace diacritics 
Javascript :: Appending the option element using jquery each function 
Javascript :: An invalid form control with ... is not focusable. 
Javascript :: html get form elements 
Javascript :: express return svg 
Javascript :: javascript array clear 
Javascript :: useEffect in nextjs 
Javascript :: kendo jquery grid refresh data 
Javascript :: Learn how to use Js export and import. 
Javascript :: fetch method post handing the post add on php 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =