title: Adding my function into another?
body: <p>I've added the first function superscriptDesignation to this code and now want to call it on the items in teamDesignations. Doing </p>
  
  <pre><code>return superscriptDesignation(teamDesignations);
  </code></pre>
  
  <p>gives me an error in the console that .replace is not defined. How can I add my function superscriptDesignation to the teamDesignations?</p>
  
  <p>JS</p>
  
  <pre><code>  var superscriptDesignation = function(designation) {
          return designation.replace(/(®)/ig, "&lt;sup&gt;&amp;reg;&lt;/sup&gt;").replace(/(™)/ig, "&lt;sup&gt; &amp;#153;&lt;/sup&gt;");
      };
      var getTeamDesignations = function(profile) {
          //Designations for a single team member                                                                                                                               
          var teamDesignations = [];
          if (profile.team_members) {
              teamDesignations = _.chain(profile.team_members)
                  .filter(_.compose(_.isArray, _.property('team_member_designations')))
                  .map(_.property('team_member_designations'))
                  .flatten()
                  .uniq()
                  .value();
          }
          return teamDesignations;
      };
  </code></pre>