function cagar() {
console.log('cagando')
}
class Cachorro {
constructor () {
Object.assign(Cachorro.prototype, { cagar })
}
class Animal {
constructor({ name }) {
this.name = name
}
}
class Dog extends Animal {
constructor(props){
super(props)
// PROTOTYPE WAY
function Person (props) {
this.name = props.name
this.age = props.age
}
Person.prototype.say = function (word) {
console.log(`${this.name}: ${word}`)
}
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
// set up arrays | |
var numbers = [1,12,4,18,9,7,11,3,101,5,6]; | |
var strings = ['this','is','a','collection','of','words']; | |
// array.reduce - find largest number | |
var largestValue = numbers.reduce(function(x,y){ return x > y ? x : y }); | |
console.log('largest number: ' + largestValue); | |
// array.reduce - find longest string |
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
// set up arrays | |
var numbers = [1,12,4,18,9,7,11,3,101,5,6]; | |
var strings = ['this','is','a','collection','of','words']; | |
// array.reduce - find largest number | |
var largestValue = numbers.reduce(function(x,y){ return x > y ? x : y }); | |
console.log('largest number: ' + largestValue); | |
// array.reduce - find longest string |
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
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install git | |
brew install node | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash | |
# brew cask install iterm2 | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
chsh -s /bin/zsh | |
brew install watchman | |
ssh-keygen |
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
sudo apt-get install vim; | |
sudo apt-get install git; | |
sudo apt-get install terminator; | |
sudo apt-get install zsh; | |
curl -L http://install.ohmyz.sh | sh; | |
chsh -s $(which zsh); | |
sudo apt-get install curl; | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash; |
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
AdvancedNewFile, | |
Babel, | |
Bracketeer, | |
DocBlockr, | |
Dockerfile Syntax Highlighting, | |
EditorConfig, | |
Emmet, | |
FindKeyConflicts, | |
Git, | |
GitGutter, |