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 x = function() { 
	var cards = []; 
	cards.push(1,2,3,4,5,6,7,8,9,10); 
	console.log('x: ' + cards); 
	return cards;  
};
var y = function() { 
  var cards = x(); 
  cards.pop(); 
  console.log('y: ' + cards); 
  return cards; 
}; 
var z = function() { 
  var cards = y(); 
  cards.pop(); 
  console.log('z: ' + cards); 
  return cards; 
}; 

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