[Javascript2] fine-tuning of removeArticles
This commit is contained in:
parent
c8ab1a7b3c
commit
0a8355c190
@ -20,11 +20,11 @@ const bands = [
|
|||||||
* @returns {string} the band name with articles removed
|
* @returns {string} the band name with articles removed
|
||||||
*/
|
*/
|
||||||
function removeArticles(band) {
|
function removeArticles(band) {
|
||||||
if (band.substring(0, 3) === 'The') {
|
if (band.substring(0, 4) === 'The ') {
|
||||||
return band.substring(4);
|
return band.substring(4);
|
||||||
} else if (band.substring(0, 1) === 'A') {
|
} else if (band.substring(0, 2) === 'A ') {
|
||||||
return band.substring(2);
|
return band.substring(2);
|
||||||
} else if (band.substring(0, 2) === 'An') {
|
} else if (band.substring(0, 3) === 'An ') {
|
||||||
return band.substring(3);
|
return band.substring(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user