forked from AlreadyBored/basic-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'AB/master'
add A new solution for a new condition
- Loading branch information
Showing
18 changed files
with
1,197 additions
and
528 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const CustomError = class CustomError extends Error { | ||
constructor(message) { | ||
super(message); | ||
this._validationProp = 'NA'; | ||
} | ||
}; | ||
|
||
module.exports = CustomError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
const CONSOLE_LOG_ENABLE = false; | ||
|
||
module.exports = function createDreamTeam(members_array/* members */) { | ||
if (!(Array.isArray(members_array))){ | ||
if (CONSOLE_LOG_ENABLE) console.log ((Array.isArray(members_array))); | ||
if (!(Array.isArray(members_array))) { | ||
if (CONSOLE_LOG_ENABLE) console.log((Array.isArray(members_array))); | ||
return false; | ||
} | ||
|
||
let team = ''; | ||
|
||
for (let i = 0; i<members_array.length; i++) { | ||
if (typeof( members_array[i] ) === "string"){ | ||
team += members_array[i].match(/\w/); | ||
for (let i = 0; i < members_array.length; i++) { | ||
if (typeof (members_array[i]) === "string") { | ||
team += members_array[i].match(/\w/); | ||
} | ||
} | ||
|
||
if (CONSOLE_LOG_ENABLE) console.log(team); | ||
if (CONSOLE_LOG_ENABLE) console.log(team); | ||
team = team.toUpperCase().split("").sort().join(""); | ||
if (CONSOLE_LOG_ENABLE) console.log(team); | ||
if (CONSOLE_LOG_ENABLE) console.log(team); | ||
|
||
if (team === "") { | ||
return false; | ||
} | ||
return team; | ||
// throw 'Not implemented'; | ||
// // remove line with error and write your code here | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.