@yusufwibisono/custom-pkg-util-js
v1.0.5
Published
test create pkg
Downloads
3
Readme
Custom Package
Numeric Operations
sum(a: number, b: number): number
: Adds two numbers.subtract(a: number, b: number): number
: Subtracts b from a.multiply(a: number, b: number): number
: Multiplies two numbers.divide(a: number, b: number): number | string
: Divides a by b. Returns 'Cannot divide by zero' if b is 0.square(a: number): number
: Returns the square of a.cube(a: number): number
: Returns the cube of a.isEven(a: number): boolean
: Checks if a is even.isOdd(a: number): boolean
: Checks if a is odd.
String Operations
capitalize(str: string): string
: Capitalizes the first letter of a string.reverse(str: string): string
: Reverses the characters of a string.length(str: string): number
: Returns the length of a string.countWords(str: string): number
: Counts the number of words in a string.replaceVowels(str: string): string
: Replaces vowels in a string with '*'.toUpperCase(str: string): string
: Converts a string to uppercase.toLowerCase(str: string): string
: Converts a string to lowercase.