I want to construct an array of objects programmatically. The end result I am expecting is this
[{"nickname":"xxx"},{"nickname":"yyy"},{"nickname":"zzz"}]
This is my code
@tagged_user_array = []
//pingUsers is the array which stored the list or nicknames 'xxx', 'yyy' and 'zzz'
$.each @pingUsers, (index, nick) =>
@tagged_user_array.push(nick)
With my code above, I am unable to get my expected result. What do I need to modify in order to get my expected result?