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 :: nest js crons 
Javascript :: how to wait till jquery post request has been made 
Javascript :: flutter post request 
Javascript :: javascript eingabe in inputfielder übernehmen 
Javascript :: post method in javascript 
Javascript :: javascript events 
Javascript :: jquery parse html 
Javascript :: react this.state 
Javascript :: js string insert space 
Javascript :: react setstate concat string 
Javascript :: how to use react-native-vector-icons 
Javascript :: moment.js get time from now 
Javascript :: Uncaught (in promise): NotReadableError: Could not start video source 
Javascript :: send sms with twilio 
Javascript :: openstreetmap api example javascript 
Javascript :: connect node with react 
Javascript :: puppeteer block request javascript 
Javascript :: style.backgroundcolor 
Javascript :: angular add ellipsis to template string 
Javascript :: express json middleware 
Javascript :: eslint disable line 
Javascript :: js delete all from array 
Javascript :: one line if statement javascript 
Javascript :: react insert variable into string 
Javascript :: json parse js 
Javascript :: how to uninstall nodejs web server 
Javascript :: how to decode jwt token in react 
Javascript :: js indexof string 
Javascript :: vuejs on route scrollbehavior 
Javascript :: compare date value in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =