I'm new to typescript, can someone help me convert this PHP array to be converted to query parameter
$array = [
'sort' => [
'column1' => 'asc',
'column2' => 'desc',
],
];
// expected query
'sort%5Bcolumn1%5D=asc&sort%5Bcolumn2%5D=desc'
I tried it on typescript but when it gets converted to query string, it becomes an object.
let array = [];
array['sort'] = {
'column1': 'asc',
'column2': 'desc'
};
// it gets converted to this
'sort=%5Bobject%20Object%5D'