title: Underscore, find and change value in object
body: <p>I am trying to find and replace a value in a function in an object</p>
  
  <p>My object looks like this : </p>
  
  <pre><code> var testStates = [{
      "module": "module1",
      "customUrl": [
          { "mod1": "2" },
          { "mod2": "1" }
      ]
  }, {
      "module": "module2",
      "customUrl": [
          { "mod3": "false" },
          { "mod4": "5" }
      ]
  }
  ];
  </code></pre>
  
  <p>And my function is like this :</p>
  
  <pre><code> myFunction = function(mod, name, replace){
   //replace item in testStates
  </code></pre>
  
  <p>}</p>
  
  <p>And basically what i'm trying to do is use those vars to search inside where mod is a "module" value, name is a "mod"'s key (like mod1 or mod2 in the exampels), and replace is the value to replace on that selected mod.</p>
  
  <p>So if i said </p>
  
  <pre><code> myfunction(module1, mod1, 5);
  </code></pre>
  
  <p>I would then want the object to look like </p>
  
  <pre><code>    var testStates = [{
      "module": "module1",
      "customUrl": [
          { "mod1": "5" },   ////Changed
          { "mod2": "1" }
      ]
  }, {
      "module": "module2",
      "customUrl": [
          { "mod3": "false" },
          { "mod4": "5" }
      ]
  }
  ];
  </code></pre>
  
  <p>Kind of like a find and replace on an object. I'm not sure how to tackle this with underscore, would love some help! Thanks for reading!</p>