Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tags = {
- 1: "the-reality",
- 2: "your-life",
- 3: "your-voice",
- 4: "amped-up"
- };
- //Outside of Loop, at top of functionality
- String.prototype.toTitleCase = function(n) {
- var s = this;
- if (1 !== n) s = s.toLowerCase();
- return s.replace(/\b[a-z]/g,function(f){return f.toUpperCase()});
- }
- //inside the for/each loop
- var stringArray = tags[i].replace(/-/g, ""); var stringArray = i.toTitleCase();
- // if tags[i] was initially "the-reality" than stringArray will now = "The Reality"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement