Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro is JavaScript
Message
De
10/02/2015 08:06:34
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01615034
Message ID:
01615078
Vues:
24
You only asked for syntax. Coding with such syntactic sugar to eliminate the redundancies will IMO still be a patch - the code is the equivalent to recurring fields in a record before normalization. So create a record/object for each index to clean up and hang those objects into a list, dict or even easier an array with index as index. So now you have some refacturing advice as well...

>>>>Does
>>>>
>>>>IndexStr = index.toString();
>>>>$scope.currentTemplate["aAutoDep"+IndexStr] = '';
>>>>
>>>>
>>>>work?
>>>>
>>>I'll try, thanks. Do you know if we can access object properties in JavaScript this way?
>>
>>In Python properties are implemented in a dict, and if I am not confusing something in JS the dominant data structure is the assoiciative array.
>
>I made an update to my post with this blog reference
>
>http://nfriedly.com/techblog/2009/06/advanced-javascript-objects-arrays-and-array-like-objects/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform