My main goal with this code is to successfully console.log(createdAnimal) and have the objectAnimal with specific parameters printed out. The following code snippet demonstrates the desired parameters:
animalMaker('cat','flying',true);
Although invoking the animalMaker function works as intended, I am struggling to get the same outcome when using console.log(createdAnimal).
Thank you in advance for any assistance!
Below is the provided code:
function animalMaker(inputType, inputSuperPower, inputCanFly){
var objectAnimal = {
'type': inputType,
'inputSuperPower': inputSuperPower,
'inputCanFly': inputCanFly,
'createdBy': 'Scotty'
};
console.log(objectAnimal)
}
var createdAnimal = animalMaker('cat','flying',true);
console.log(createdAnimal);