This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyForm extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { message: "Hello, World" }; | |
} | |
render() { | |
const input = React.createElement('input', { | |
type: 'text', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleChange(event) { | |
this.setState({ message: event.target.value }, () => { | |
console.log(this.state) | |
}); | |
} |
OlderNewer