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 :: jquery insert after element 
Javascript :: ajax syntax in javascript 
Javascript :: get client id socket io 
Javascript :: mongodb aggregate node.js 
Javascript :: change color js 
Javascript :: javascript array 
Javascript :: javascript two digits number 
Javascript :: onclick change image javascript example 
Javascript :: jquery upload image 
Javascript :: download jquery 
Javascript :: for in 
Javascript :: javascript how to reverse a string 
Javascript :: Close popup window 
Javascript :: detect resize window javascript 
Javascript :: javascript queryselector child element 
Javascript :: number round 
Javascript :: express get query parameters 
Javascript :: e.target.text react 
Javascript :: javascript change color of text input 
Javascript :: javascript kill ajax request 
Javascript :: jquery change tabs 
Javascript :: jquery show password 
Javascript :: angular bind style value 
Javascript :: change data js 
Javascript :: javascript password hashing 
Javascript :: swiperjs cdn 
Javascript :: c# print object to json 
Javascript :: copy object array javascript 
Javascript :: jsx classname multiple 
Javascript :: npm execute script with nodemon 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =