10 lines
281 B
TypeScript
10 lines
281 B
TypeScript
|
export const getInitials = (fullName: string): string => {
|
||
|
// Extract initials from the name
|
||
|
const words = fullName.split(" ");
|
||
|
const initials = words
|
||
|
.map((word) => word[0])
|
||
|
.slice(0, 2)
|
||
|
.join("")
|
||
|
.toUpperCase();
|
||
|
return initials;
|
||
|
};
|