Improve the username generation so that the function creates unique random names based on the three components, the user's name, and random numbers. Any of those items may be omitted in the username as long as the result is unique. 

const { surnames, maleNames, femaleNames } = require("./\_names");
const { nouns, colors, adjectives } = require("./\_words");

const emailDomains = [
 "gmail.com",
 "yahoo.com",
 "hotmail.com",
 "aol.com",
 "me.com",
 "msn.com",
 "live.com",
];
const uniqueEmails = [];
const usernameComponents = [nouns, colors, adjectives];
const passwordChars =
 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\*?<>,.;:|`~";
const genders = ["male", "female"];

class User {
 constructor(id) {
 this.id = id;
 this.name = this.\_generateName();
 this.email = this.\_generateEmail();
 this.password = this.\_generatePassword();
 this.birthday = this.\_generateBirthday();
 this.phone = this.\_generatePhone();
 }

 \_generateName() {
 this.name = `${this.\_generateFirstName()} ${this.\_generateLastName()}`;
 return this.name;
 }

 \_generateFirstName() {
 this.gender = genders[Math.floor(Math.random() \* genders.length)];
 switch (this.gender) {
 case genders[0]:
 return maleNames[Math.floor(Math.random() \* maleNames.length)];
 case genders[1]:
 return femaleNames[Math.floor(Math.random() \* femaleNames.length)];
 default:
 return "Unknown";
 }
 }
 \_generateLastName() {
 return surnames[Math.floor(Math.random() \* surnames.length)];
 }
 \_generateEmail() {
 let email = `${this.\_generateUsername()}@${
 emailDomains[Math.floor(Math.random() \* emailDomains.length)]
 }`;
 if (!uniqueEmails.includes(email)) {
 uniqueEmails.push(email);
 return email;
 } else {
 return this.\_generateEmail();
 } 
 }
 \_generateUsername() {
 let \_username = "";
 for (
 let i = 0;
 i < Math.floor(Math.random() \* usernameComponents.length);
 i++
 ) {
 if (Math.floor(Math.random() \* 2) % 2 === 0) {
 \_username +=
 usernameComponents[i][
 Math.floor(Math.random() \* usernameComponents[i].length)
 ];
 } else if (Math.floor(Math.random() \* 2) % 3 === 0) {
 \_username +=
 usernameComponents[i][
 Math.floor(Math.random() \* usernameComponents[i].length)
 ];
 \_username += Math.floor(Math.random() \* i).toString();
 } else {
 \_username += Math.floor(Math.random() \* 1000).toString();
 }
 }
 if (\_username.length === 0) {
 let namePart = this.name.split(" ");
 \_username += namePart
 .map(
 (part) =>
 usernameComponents[namePart.indexOf(part)][
 Math.floor(Math.random() \* namePart.indexOf(part))
 ]
 )
 .join("");
 }
 return \_username;
 }
 \_generatePassword() {
 const passwordLength = Math.floor(Math.random() \* 10) + 8;
 let password = "";
 for (let i = 0; i < passwordLength; i++) {
 password +=
 passwordChars[Math.floor(Math.random() \* passwordChars.length)];
 }
 this.password = password;
 return this.password;
 }

 \_generateBirthday() {
 const birthday = new Date();
 birthday.setFullYear(Math.floor(Math.random() \* 100) + 1920);
 birthday.setMonth(Math.floor(Math.random() \* 12));
 birthday.setDate(Math.floor(Math.random() \* 28));
 this.birthday = birthday.toISOString().split("T")[0];
 return this.birthday;
 }
 \_generatePhone() {
 const phone = new Array(10);
 for (let i = 0; i < phone.length; i++) {
 phone[i] = Math.floor(Math.random() \* 10);
 }
 const formatPhoneNumber = (phone) =>
 `+1(${phone.slice(0, 3).join("")})${phone.slice(3, 6).join("")}-${phone
 .slice(6)
 .join("")}`;
 return formatPhoneNumber(phone);
 }
 getName() {
 return this.name;
 }
 getEmail() {
 return this.email;
 }
 getPassword() {
 return this.password;
 }
 getBirthday() {
 return this.birthday;
 }
 getGender() {
 return this.\_gender;
 }
 getPhone() {
 return this.phone;
 }
 getId() {
 return this.id;
 }
 setId(id) {
 this.id = id;
 }
}

const usersArr = [];
const seedUsers = (num) => {
 for (let i = 0; i < num; i++) {
 const user = new User(i);
 usersArr.push(user);
 }
};
seedUsers(Math.floor(Math.random() \* 100));

const users = usersArr;

module.exports = users;
사용자 아이디 생성 기능을 개선하여 함수가 세 가지 구성 요소, 사용자 이름, 난수를 기반으로 고유한 임의의 이름을 생성하도록 합니다. 결과가 고유하다면 사용자 이름에서 이러한 항목 중 어느 것도 생략할 수 있습니다. const { 성, 남성 이름, 여성 이름 } = require("./\_names");const { 명사, 색상, 형용사 } = require("./\_words");const emailDomains = [ "gmail.com", "yahoo.com", "hotmail.com", "aol.com", "me.com", "msn.com", "live.com",];const uniqueEmails = [];const usernameComponents = [명사, 색상, 형용사];const passwordChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\*?<>,.;:|`~";const genders = ["male", "female"];User 클래스 { constructor(id) { this.id = id; this.name = this.\_generateName(); this.email = this.\_generateEmail(); this.password = this.\_generatePassword(); this.birthday = this.\_generateBirthday(); this.phone = this.\_generatePhone(); } \_generateName() { this.name = `${this.\_generateFirstName()} ${this.\_generateLastName()}`; this.name을 반환합니다; } \_generateFirstName() { this.gender = genders[Math.floor(Math.random() \* genders.length)]; switch (this.gender) { case genders[0]: return maleNames[Math.floor(Math.random() \* maleNames.length)]; case genders[1]: return femaleNames[Math.floor(Math.random() \* femaleNames.length)]; default: 반환 "알 수 없음"; } } \_generateLastName() { return surnames[Math.floor(Math.random() \* surnames.length)]; } \_generateEmail() { let email = `${this.\_generateUsername()}@${ emailDomains[Math.floor(Math.random() \* emailDomains.length)]] }`; if (!uniqueEmails.includes(email)) { uniqueEmails.push(email); 이메일을 반환합니다; } else { this.\_generateEmail()을 반환합니다; }  } \_generateUsername() { let \_username = ""; for ( let i = 0; i < Math.floor(Math.random() \* usernameComponents.length); i++ ) { if (Math.floor(Math.random() \* 2) % 2 === 0) { \_username += usernameComponents[i][ Math.floor(Math.random() \* usernameComponents[i].length) ]; } else if (Math.floor(Math.random() \* 2) % 3 === 0) { \_username += usernameComponents[i][ Math.floor(Math.random() \* usernameComponents[i].length) ]; \_username += Math.floor(Math.random() \* i).toString(); } else { \_username += Math.floor(Math.random() \* 1000).toString(); } } if (\_username.length === 0) { let namePart = this.name.split(" "); \_username += namePart .map( (part) => usernameComponents[namePart.indexOf(part)][ Math.floor(Math.random() \* namePart.indexOf(part)) ] ) .join(""); } 반환 \_사용자 이름; } \_generatePassword() { const passwordLength = Math.floor(Math.random() \* 10) + 8; let password = ""; for (let i = 0; i < passwordLength; i++) { password += passwordChars[Math.floor(Math.random() \* passwordChars.length)]; } this.password = password; return this.password; } \_generateBirthday() { const birthday = new Date(); birthday.setFullYear(Math.floor(Math.random() \* 100) + 1920); birthday.setMonth(Math.floor(Math.random() \* 12)); birthday.setDate(Math.floor(Math.random() \* 28)); this.birthday = birthday.toISOString().split("T")[0]; return this.birthday; } \_generatePhone() { const phone = new Array(10); for (let i = 0; i < phone.length; i++) { phone[i] = Math.floor(Math.random() \* 10); } const formatPhoneNumber = (phone) =>. `+1(${phone.slice(0, 3).join("")})${phone.slice(3, 6).join("")}-${phone .slice(6) .join("")}`; 반환 형식 전화 번호(전화); } getName() { return this.name; } getEmail() { return this.email; } getPassword() { return this.password; } getBirthday() { return this.birthday; } getGender() { return this.\_gender; } getPhone() { return this.phone; } getId() { return this.id; } setId(id) { this.id = id; }}const usersArr = [];const seedUsers = (num) => { for (let i = 0; i < num; i++) { const user = new User(i); usersArr.push(user); }};seedUsers(Math.floor(Math.random() \* 100));const users = usersArr;module.exports = users;