Skip to content

Instantly share code, notes, and snippets.

var suits = ["Hearts", "Spades", "Clubs", "Diamonds"];
var faces = ["Ace", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"];
var cards = []
for (var s=0; s<suits.length; s++) {
for (var f=0; f<faces.length; f++) {
cards.push({suit: suits[s], face: faces[f]});
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
class MyForm extends React.Component {
constructor(props) {
super(props);
this.state = { message: "Hello, World" };
}
render() {
const input = React.createElement('input', {
type: 'text',
handleChange(event) {
this.setState({ message: event.target.value }, () => {
console.log(this.state)
});
}