27
loading...
This website collects cookies to deliver better user experience
function PokeBall(name, abilities, cb){
if(typeof name === "string" && typeof abilities === "object" && typeof cb === "function"){
let theChosenOne = `You chose ${name} ability : ${abilities.name} power: ${abilities.power}`
cb(theChosenOne, null)
}
else {
cb(null, `incorrect params`)
}
}
/**
*
* @callback cb_
* @param {Object} val - returned val from the database
* @param {String} err - returned error from the database
*
*/
/**
*
* @param {String} name - name of the pokemon
* @param {Object} abilities - pokemon abilities
* @param {String} abilities.name - ability name
* @param {Number} abilities.power pokemon name
*
* @param {cb_} cb - callback function
*
*/