Skip to content

Instantly share code, notes, and snippets.

render() {
let rows = this.state.board.map((rowContent, id) => (
  <Row
  id={id}
  rowContent={rowContent}
  onClick={this._handleClick.bind(this)}
  />
  ));
render() {
let rows = this.state.board.map ((rowContent,id) => (
 <Row
 id={id} rowContent={rowContent}
 onClick={this._handleClick.bind(this)}
 />
 ));
let message = this._getMessage(this.state);
return (
 <div>
/* This function takes an integer and returns a
 * string representation with commas for every group of 3 digits.
 * See this StackOverflow post for an explanation:
 * https://goo.gl/gfe1H7
 */
var addCommas = function(number) {
return number.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, “,”);
}
/* ROW STYLES */
.row {
display: block;
}
.row:not(first-child) {
margin-top: -4px; /* display: inline-block fix */
}
.row:nth-child(1) .square {
<div class=”container”>
<div class=”row”>
  <div>
  <div>
  <p>
Look at all of these nested divs…
</p>
  <p>
There are so many that I can’t keep track!
</p>
// Initialize campaigns
$scope.campaigns = [];
// Reset function to clear search form after submit
var clearSearchForm = function() {
$scope.campaignUrl = “”;
};
// Define addCampaign function
$scope.addCampaign = function() {