+ 2

To make counting table

example - input=2 output=2,4,6,8,10,12,14,16,18,20 example2-input=3 output=3,6,9,12,15,18,21,24,27,30

8th Sep 2017, 5:52 PM
Chandra Shekhar Kumar
Chandra Shekhar Kumar - avatar
5 Réponses
+ 3
you can put any number what you want 📌 https://code.sololearn.com/WKF6lMRElwQz/?ref=app
8th Sep 2017, 8:58 PM
Ahmet Turan
Ahmet Turan - avatar
8th Sep 2017, 8:24 PM
Zephyr Koo
Zephyr Koo - avatar
+ 5
let num = parseInt(prompt("Enter a number: ")); let str = ""; for(let i = num; i <= num*10; i+=num) { str += i; if(i != num*10) { str += ", "; } } alert(str);
8th Sep 2017, 6:26 PM
ChaoticDawg
ChaoticDawg - avatar
+ 3
// Normal way in Javascript var getArray = function(input) { var outp = []; for(var i=1;i<=10;i++) outp.push(input*i); return outp; } console.log(getArray(3)); // ES6 way, using arrow function with map var getArray1=input=>Array.from(Array(10).keys()).map(i=>(i+1)*input); console.log(getArray1(3)); // another ES6 way var getArray1=input=>[...Array(10).keys()].map(i=>(i+1)*input); console.log(getArray1(3)); https://code.sololearn.com/WFAl8QZrgFpt/?ref=app
9th Sep 2017, 12:26 AM
Calviղ
Calviղ - avatar
5th Oct 2017, 4:34 PM
Muhammad Jawwad
Muhammad Jawwad - avatar