Friday, January 20, 2017

JS30 Challenge Day 17 - Sorting Without Articles


thing.innerHTML = Array.map(band=>`<li>${band}</li>`).join(‘’);

If we dont use join while outputting each array item, it gives us commas before each entry, because it toString ’s the array.

Array.sort((a,b) => a>b?1:-1);

Regex:
/^(a |an |the)/i

There has to be a space after each article otherwise it will start picking up words beginning with articles

No comments:

Post a Comment