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

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 :: get the max value from array js 
Javascript :: alert react native 
Javascript :: javascript quiz questions and answers 
Javascript :: how to access value of itself object in javascript 
Javascript :: array example 
Javascript :: splice state react 
Javascript :: react native loop in render 
Javascript :: what are undeclared and undefined variables in javascript 
Javascript :: check cookie existence js 
Javascript :: Adding an item to an array 
Javascript :: objects 
Javascript :: mdn react 
Javascript :: remove item from array 
Javascript :: save image on cloudinary 
Javascript :: break loop timeout javascript 
Javascript :: how to break from map in javascript 
Javascript :: how do you calculate what percentage a number is of another number 
Javascript :: TextInput cursor not shown react native 
Javascript :: how to interrupt scroll with jquery 
Javascript :: how to get font size in javascript 
Javascript :: display array javascript 
Javascript :: update password before saving to mongodb 
Javascript :: what would (int) (Math.random()) output 
Javascript :: get an day array when have a startDay and FinishDay js 
Javascript :: const justCoolStuff = (arr1, arr2) = arr1.filter(item = arr2.includes(item)); 
Python :: pandas merge all csv in a folder 
Python :: get random line from file python 
Python :: ParserError: Error tokenizing data. C error: Expected 1 fields in line 87, saw 2 
Python :: python selenium get image src 
Python :: python replace all new lines with space 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =