Right way to iterate over record [duplicate]

I’m trying –

export function logError(paramsToLog?: Record<string, string>): void {
    const logData: LoggerData[] = [];
    if (paramsToLog) {
        for (const key of paramsToLog) {
            logData.push(LoggerData.create(key, paramsToLog[key]));
        }
    }
    ....
}

I see eslint complaining – (parameter) paramsToLog: Record<string, string> Type 'Record<string, string>' must have a '[Symbol.iterator]()' method that returns an iterator.

Could not find any iterator in record arg.