UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

9 lines (8 loc) 302 B
/** * Calculates the digital root of a number (sum of digits until a single digit). * For example, digitalRoot(942) returns 6. * @author @dailker * @param {number} n - The number to process. * @returns {number} The digital root. */ export declare function digitalRoot(n: number): number;