Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to create object dynamically in javascript

stuff = function (thing, callback) {
  var inputs  = $('div.quantity > input').map(function(){
    return {
      [this.attr('name')]: this.attr('value'),
    };
  }) 

  callback(null, inputs);
}
 
PREVIOUS NEXT
Tagged: #create #object #dynamically #javascript
ADD COMMENT
Topic
Name
3+2 =