Args of a function to a method

Viewed 10

i have an function and i want to pass the arguments as a method of an lib

const bringAnimal=(animalwhoiwillcall)=>{
    const A = animals.animalwhoiwillcall().then().catch()
    return A
}

bringAnimal('cat');

i expected that his happens :

const bringAnimal=(animalwhoiwillcall)=>{
    const A = animals.cat().then().catch()
    return A
}

but dont, the code dont recognize this. how do i pass the arg of an function to a method?

0 Answers
Related