how can i generate array or object with own index?
in php i can:
$array = array();
foreach($users as $user){
$array[$user] = $user;
}
and in jQuery?
var arr = new Array();
$('input').each(function(){
arr[$(this).val()] = $(this).val();
})
i would like use JS Object for this, but how?
It’s basically this simple. After this, you can access them either by
obj[value]orobj.value.