title: making a Javascript object inside another object
body: <p>I want to make an object using <code>angular.forEach()</code> function and then I need to push another object and initialize all the values to false but the below way points errors. </p>
  
  <p>How can do this correctly? if I use "item.id" and "index.id" it will not create the intended functionality. I am attaching a photo to point out the intended functionality.<a href="http://i.stack.imgur.com/up64z.jpg" rel="nofollow">link for image</a>   </p>
  
  <pre><code>        angular.forEach(metaData.validationRules, function (item, key) {
              //want to push object to another object
              angular.forEach(insarray.instances, function (index, key) {
                 $scope.select = {
                      item.id: {
                          index.id:false
                      }
                  }
              });
          });
  </code></pre>