JSFiddle - React, Tailwind, and code Playground
by LyndseyB
HTML
Print out the table in a matrix like fashion, each number formatted to a width of 4 (The numbers are right-aligned and strip out leading/trailing spaces on each line). The first 3 line will look like:
1 2 3 4 5 6 7 8 9 10 11 12
2 4 6 8 10 12 14 16 18 20 22 24
3 6 9 12 15 18 21 24 27 30 33 36
Submit your solution in a file (some file name).(py2| c| cpp| java| rb| pl| php| tcl| clj| js| scala| cs| m| py3| hs| go| bash| lua) or use the online editor.
JavaScript
var i = 1, stop = 1, output = '';
for(i; i<=stop; i++) {
console.log(i + next(i,stop));
}
function next(i,j) {
if(j <= 12) {
j++;
output+= (i+i);
next((i),j);
}
return output;
}