Advertisement
orksnork

Untitled

Jun 9th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //This is where babe doesn't do this part
  2.  
  3. String.prototype.toTitleCase = function(n) {
  4.     var s = this;
  5.     if (1 !== n) s = s.toLowerCase();
  6.     return s.replace(/\b[a-z]/g, function(f) {
  7.         return f.toUpperCase()
  8.     });
  9. }
  10.  
  11. //and where she whatever
  12. var tags = {
  13.     1: "the-reality",
  14.     2: "your-life",
  15.     3: "your-voice",
  16.     4: "amped-up"
  17. };
  18.  
  19. //and where she doesn't have underscore because the site is heavy even though i've been telling her start with underscore and it's 5.7kb for the min but heh
  20.  
  21. _.each(tags, function(i) {
  22.     var stringArray = i.replace(/-/g," "); stringArray = stringArray.toTitleCase();
  23.     console.log(stringArray);
  24.   })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement