JSFiddle - React, Tailwind, and code Playground

by Patel1327

HTML

<button onclick="start()">
1st button
</button>
<button onclick="start1()">
2nd button
</button>

JavaScript

var x = [];
var y = [];

function start() {
  for (i = 0; i < 5; i++) {
    x.push(Math.floor(Math.random() * 10) + 1)
  }
  alert(x);
}
function start1() {
  for (i = 0; i < 5; i++) {
y.push(3*x[i])
}
alert(y)
}