i want to create array with row like this :
dateMetric : [{date : DatNoDuplicate[i] , ClickCount : 0 , Retweet : 0 , LikeCount : 0 , ShareCount : 0, Tweet : 0, CommentCount: 0, SumMetric: 0},
{date : DatNoDuplicate[i] , ClickCount : 0 , Retweet : 0 , LikeCount : 0 , ShareCount : 0, Tweet : 0, CommentCount: 0, SumMetric: 0},
]
but the attribute in rows( ClickCount, Retweet, LikeCount, ShareCount, Tweet, CommentCount) will be defined from other array,
Array nameMetric contains this name of rows(( ClickCount, Retweet, LikeCount, …)
so if in nameMetric there is element (likeNumber, TweetNumber, …..) the array dateMetric will contain rows like this :
dateMetric
date : DatNoDuplicate[i] , likeNumber: 0 , TweetNumber: 0 , ... , SumMetric: 0})
please help, i can reformulate the problem if it’s not explained well .
Try this: http://jsfiddle.net/8cetN/
You can look up your name array to define the properties of each row object: