Created
August 30, 2009 19:29
-
-
Save web-zen/178094 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.log(jsUsers); | |
| //returns Object 12=Abraham,Zac 166=Anderson,James 81=Aubin,Richard | |
| var users = {}; | |
| users['value']={}; | |
| users['label']={}; | |
| for (i in jsUsers) { | |
| users['value'][i]=i; | |
| users['label'][i]=users[i] | |
| } | |
| console.log(users); | |
| // returns Object value=Object label=Object | |
| I need a format like: | |
| var users= [ | |
| {value:'12',label:'Smith,Zac'}, | |
| {value:'166',label:'Jones,James'}, | |
| ]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment