let's say we want to create a greeter function that will take a greeting copy but we know that this copy will change depending on the context.
we can do:
constgreeter=copy=>{returnname=>`${name}${copy}`}constpoliteGreeter=greeter('you are very welcome here')constweirdGreeter=greeter('you look weird today!')console.log(politeGreeter('Ysael'))// Ysael you are very welcome hereconsole.log(weirdGreeter('Ysael'))// Ysael you look weird today!
witch will allow us to make different greeter functions.
Hope that helps :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Alvaro,
thanks :)
let's say we want to create a greeter function that will take a greeting copy but we know that this copy will change depending on the context.
we can do:
witch will allow us to make different greeter functions.
Hope that helps :)