Skip to content

Comments

objects.ts done#24

Closed
buayyad wants to merge 2 commits intoJoinCODED:mainfrom
buayyad:main
Closed

objects.ts done#24
buayyad wants to merge 2 commits intoJoinCODED:mainfrom
buayyad:main

Conversation

@buayyad
Copy link

@buayyad buayyad commented Jul 22, 2025

No description provided.

@shereengh
Copy link

if (Array.isArray(book.author)) {
book.author.push(additionalAuthor);
} else if (book.author) {
book.author = [book.author, additionalAuthor];
} else {
book.author = [additionalAuthor];
}

No need for else if, just else {
book.author = [book.author, additionalAuthor];
}

@buayyad buayyad closed this by deleting the head repository Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants