Created
          July 25, 2020 07:15 
        
      - 
      
- 
        Save hasanuzzamanbe/d9256ed4cd2751e6d172a39aea4983e7 to your computer and use it in GitHub Desktop. 
    Make slug to string
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function makeTitle(slug) { | |
| var words = slug.split('-'); | |
| for (var i = 0; i < words.length; i++) { | |
| var word = words[i]; | |
| words[i] = word.charAt(0).toUpperCase() + word.slice(1); | |
| } | |
| return words.join(' '); | |
| } | |
| // makeTitle(lorem-ipsum) expected output: Lorem Ipsum | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment