This file contains 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
<button onClick={this.generateText} className="button">Generate</button> | |
... | |
{ /* Results */ } | |
<section className="results"> | |
{ this.state.documents.map((value, index) => { | |
return ( | |
<div key={index} className="results__result"> | |
<div className="results__result__image"> |
This file contains 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
function getYearMonthDay(isoDateTime) { | |
const year = date.getFullYear() | |
const month = (date.getMonth() + 1 < 10 ? '0' : '') + (date.getMonth() + 1) | |
const day = date.getDate(); | |
return year + '/' + month + '/' + day | |
} | |
function getDayMonthYear(isoDateTime) { | |
const year = date.getFullYear() | |
const month = (date.getMonth() + 1 < 10 ? '0' : '') + (date.getMonth() + 1) |
This file contains 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
const array = [ | |
{ id: 111, framework: 'react' }, | |
{ id: 222, framework: 'angular' }, | |
{ id: 333, framework: 'vue' } | |
]; | |
const reducerCallback = (prevItem, currItem) => { | |
return { | |
id: prevItem.id + currItem.id, | |
framework: prevItem.framework + "-" + currItem.framework |
This file contains 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
const array = [1,5,3,9,6,2,4] | |
const reducerCallback = (prevItem, currItem) => { | |
return prevItem + currItem | |
} | |
console.log(array.reduce(reducerCallback)) // 30 |
This file contains 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
const survey = [ | |
{ name: "Zuri", votedFramework: 'react' }, | |
{ name: "Sofia", votedFramework: 'angular' }, | |
{ name: "Elon", votedFramework: 'react' }, | |
{ name: "Joe", votedFramework: 'react' }, | |
{ name: "Alex", votedFramework: 'angular' }, | |
{ name: "Josh", votedFramework: 'vue' }, | |
{ name: "Jade", votedFramework: 'react' }, | |
{ name: "Ted", votedFramework: 'angular' }, | |
{ name: "Leo", votedFramework: 'react' }, |
This file contains 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
const survey = [ | |
{ name: "Zuri", votedFramework: 'react' }, | |
{ name: "Sofia", votedFramework: 'angular' }, | |
{ name: "Elon", votedFramework: 'react' }, | |
{ name: "Joe", votedFramework: 'react' }, | |
{ name: "Alex", votedFramework: 'angular' }, | |
{ name: "Josh", votedFramework: 'vue' }, | |
{ name: "Jade", votedFramework: 'react' }, | |
{ name: "Ted", votedFramework: 'angular' }, | |
{ name: "Leo", votedFramework: 'react' }, |
OlderNewer