UNPKG

@azizbecha/strkit

Version:

strkit is a utility library offering a collection of essential string functions including validation, case conversion, truncation, and more. Ideal for both JavaScript and TypeScript developers to simplify string operations in their applications.

15 lines (14 loc) 516 B
/** * Checks if two strings are anagrams of each other. * Two strings are considered anagrams if they contain the same characters * in the same frequency, but arranged in any order. * * @param str1 - The first string. * @param str2 - The second string. * @returns True if the two strings are anagrams, false otherwise. * * @example * isAnagram("listen", "silent"); // Output: true * isAnagram("hello", "world"); // Output: false */ export default function isAnagram(str1: string, str2: string): boolean;