Quantcast
Channel: freeCodeCamp Challenge Guide: Title Case a Sentence
Viewing all articles
Browse latest Browse all 50

freeCodeCamp Challenge Guide: Title Case a Sentence

$
0
0

@sanchovia wrote:

Is there someone who would be able to verify why this is happening? Moderators perhaps?

[spoiler]function titleCase(array) {
  var finalArray = '';
  var lowerC = array.toLowerCase().split(' ');
  for(var i = 0; i < lowerC.length; i++) {
     var newArray = lowerC[i].replace(/[a-zA-Z]/, function(s) {return s.toUpperCase(); });
     finalArray += newArray + " "; 
  }  
  return ('"' + finalArray.slice(0, -1) + '"');
}[/spoiler]

I have also uploaded my function. Used the same .slice(0, -1). Works on Chrome Developer Tools. Why not here? Curious…

Read full topic


Viewing all articles
Browse latest Browse all 50

Trending Articles


Pokemon para colorear


HOY PANGIT, MAGBAYAD KA!


Sapos para colorear


Patama tagalog quotes – Move On Quotes


Tagalog Breakup Quotes


RE: Mutton Pies (frankie241)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo Create - Video Maker & Editor 1.5.2 by Vimeo Inc


Vimeo 10.7.1 by Vimeo.com, Inc.


Vimeo 11.8.1 by Vimeo.com, Inc.