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
const pureMultiplyItemsBy = (arrayOfNumbers, multiplier) => { | |
return arrayOfNumbers.map(_ => _ * multiplier); | |
} | |
const impureMultiplyItemsBy = (arrayOfNumbers, multiplier) => { | |
for (let i = 0; i < arrayOfNumbers.length; i++) { | |
arrayOfNumbers[i] *= multiplier; | |
} | |
return arrayOfNumbers; | |
} |
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 Example extends React.Component { | |
contructor(props) { | |
super(props); | |
} | |
componentDidMount() { | |
console.log("component has been mounted"); | |
} | |
componentDidUpdate() { | |
console.log("component has been updated"); |