Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Machine extends React.Component {
- render(){
- doSpin();
- function doSpin() {
- let num = Math.floor(Math.random() * 3) +1 ;
- return(num);
- }
- function machine(num) {
- if (num === 1) {
- const x = 'x';
- return x;
- } else if (num === 2){
- const y = 'y';
- return y
- } else {
- const z = 'z';
- return z;
- }
- }
- return(
- <p>{machine()},{machine()},{machine()} </p>
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement