Callback function does not print object

let allUserData = [];

const logStuff = (supply) => {

    if (typeof supply === 'string') {

        console.log(supply)

    } else if (typeof suppy === 'object') {

        for (let item in supply) {

            console.log(item + ':' + supply[item])

        }

    } 

}

const getInput = (options, callback) => {

    allUserData.push(options);

    callback(options);

}

getInput('Brian', logStuff)

getInput({ colour: 'cyan'}, logStuff)

This is a simple program I wrote that utilizes a callback function to print whatever argument is supplied (string or object).
It prints the string but not the object. Please help

where have you defined the suppy variable?
you use it but have never defined it

Ah, thanks! That was a typo, and I meant to write ‘supply’.
If I can’t even debug a dozen lines of code, I wonder how I’d fare with hundreds or even thousands. Thanks again

don’t worry too much, typos will always make everything not work.

in time you will develop more tools to debug and catch these things