Includes Function Javascript

Conditionals Javascript

function printAnimals(animal) {
    const animals = ['dog', 'cat', 'hamster', 'turtle'];

    if (animals.includes(animal)) {
        return `${animal} is an animal`;
    } else {
        return `${animal} not our kind`;
    }
}

// > console.log(printAnimals('monster'))