Posts

Showing posts from July, 2015

Currying - JavaScript

//English <!-- What is currying? --> Currying is when you break a complex function into a serie of functions. It means that if you have a function that takes 2 arguments, you can break it into 2, each one will receive one parameter, something like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 //Complex Function function greetingsComplex(msg,name){ console.log(msg + ', ' + name); } //Simple Function function greetingsEasy(msg){ return function (name){ console.log(msg + ', ' + name); } } greetingsComplex( 'Hello' , 'Carlos' ); greetingsComplex( 'Hello' , 'Ulises' ); greetingsComplex( 'Hello' , 'Hector' ); var greetings = greetingsEasy( 'Hello' ); greetings( 'Carlos' ); greetings( 'Ulises' ); greetings( 'Hector' ); As you can see above, it's easier to understand the easiest way t

JUST FOR FUN - Space Invaders purely JS/CSS

//English Hi guys, today I want to share with you something that I did during my leisure time: Space Invaders with Javascript! Please feel free to see it in action on my plunker . //Español Hola chavos, hoy quiero compartir con ustedes algo que realize en mi tiempo de ocio: Space Invaders con Javascript! Por favor vayan a verlo en acción y diviértanse en mi plunker .