I found pact
function very useful (in php). Here is what it does:
$some_var = 'value';
$ar = pact('some_var');
//now $ar is array('some_var' => 'value')
So it create array from variables which you specify, when key for elements is variable name. Is there any kind of function in javascript ?
I found pact
function very useful (in php). Here is what it does:
$some_var = 'value';
$ar = pact('some_var');
//now $ar is array('some_var' => 'value')
So it create array from variables which you specify, when key for elements is variable name. Is there any kind of function in javascript ?
Share Improve this question asked Apr 29, 2013 at 3:22 kirugankirugan 2,6243 gold badges24 silver badges41 bronze badges 3- Please consider changing the accepted answer to stackoverflow./a/45884534/6047611 – A. L. Strine Commented Dec 6, 2019 at 0:36
- Done. But it seems unusual on stackoverflow to change accepted answer after 4 years. – kirugan Commented Dec 6, 2019 at 17:06
- Thank you, this will help the next person who finds this post