Created
November 21, 2017 10:47
-
-
Save fox1t/2392d54e874a74da1ddca8427f27b099 to your computer and use it in GitHub Desktop.
Dummy test
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
// immagina che pippo e giggio siano due oggetti molto più complessi | |
// e che tu conosca la signature con la quale verrà lanciata la funzione callback di | |
// highGreetings. Non hai bisogno del primo parametro, ma solo del secondo. | |
const highGreetings = (fn) => | |
fn('pippo', 'gigio') | |
// hai bisogno per forza di gigio | |
// una possibilità è: | |
highGreetings((_, y) => { | |
console.log(y) | |
}) | |
// l'altra: | |
highGreetings((...args) => { | |
console.log(args[1]) | |
}) | |
// altrimenti alla vecchia: | |
highGreetings((x, y) => { | |
console.log(y) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment