mardi 12 mai 2015

Basic «reflection» in JS [duplicate]

This question already has an answer here:

Can I:

  1. Get JS object properties as array?
  2. Get property by name (like obj.prop('propname').val())
  3. Set property value by name (obj.prop('propname').val('WAT?'))

Why I need this: I have some model declaration and want parse JSON data according to this.





Aucun commentaire:

Enregistrer un commentaire