Last active
June 21, 2017 20:33
-
-
Save rupeshtiwari/3b7d20a893853b1dd944393386c9a14a to your computer and use it in GitHub Desktop.
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 f = a => b => c => a+b+c; | |
const result = f(1)(2)(3); | |
console.log(result); | |
//--------------------------------------- | |
const one = document.getElementById('one'); | |
const two = document.getElementById('two'); | |
const three = document.getElementById('three'); | |
const f = a => b => c => a.addEventListener(b, (event)=>{ | |
event.target.style.backgroundColor= c; | |
}); | |
const result = f(one)('click')('red'); | |
//--------------------------------- | |
const one = document.getElementById('one'); | |
const two = document.getElementById('two'); | |
const three = document.getElementById('three'); | |
const f = a => b => c => a.addEventListener(b, (event)=>{ | |
event.target.style.backgroundColor= c; | |
}); | |
const oneEventColor = f(one); | |
const twoEventColor = f(two); | |
oneEventColor('mouseover')('blue'); | |
twoEventColor('mouseout')('green'); | |
//------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment