mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-09 21:55:46 +08:00
Fix/code smells (#1338)
* ♻️ refactor: improving and fixing some code * Updated Documentation in README.md * ♻️ refactor: improving isLeapYear * 🐛 chore: back changes * 🐛 fix: using reduce instead forEach * 🐛 fix: using reduce instead forEach * 🐛 fix: removing duplicated code * 🐛 chore: removing .js --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -19,7 +19,7 @@ const DateToDay = (dd, mm, yyyy) => {
|
||||
|
||||
const DateDayDifference = (date1, date2) => {
|
||||
// firstly, check that both input are string or not.
|
||||
if (typeof date1 !== 'string' && typeof date2 !== 'string') {
|
||||
if (typeof date1 !== 'string' || typeof date2 !== 'string') {
|
||||
return new TypeError('Argument is not a string.')
|
||||
}
|
||||
// extract the first date
|
||||
|
Reference in New Issue
Block a user