JSFiddle - React, Tailwind, and code Playground

by guyluchenbill

HTML

<input type='button' id='first' value='first' /> 
<input type='button' id='second' value='second' /> 

<div id="output"> 

</div>

JavaScript

var $ = function(id) { 
	return document.getElementById(id); 
};  

var cards = []; 

var x = function() { 
	cards.push(1,2,3,4,5,6,7,8,9,10); 
	console.log('x: ' + cards); 
	return cards;  
};
var y = function() { 
  cards.pop(); 
  console.log('y: ' + cards); 
  z();
  return cards; 
}; 

var z = function() { 
  cards.pop(); 
  console.log('z: ' + cards); 
  return cards; 
}; 

var f = $('first');
var s = $('second'); 
f.addEventListener('click', x, false); 
s.addEventListener('click', y, false);