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.

10 lines (9 loc) 396 B
/** * Divides a by b, returning a fallback value if b is zero. * @author @dailker * @param {number} a - The numerator. * @param {number} b - The denominator. * @param {number} [fallback=0] - The value to return if b is zero. * @returns {number} The result of a / b, or fallback if b is zero. */ export declare function safeDivide(a: number, b: number, fallback?: number): number;