Option to preserve empty arrays and objects at "qs.stringify()" funtion of qs package in react

121 Views Asked by At

I want to also preserve an empty array but the qs package is deleting the empty array key from the stringified data:

const data = {
  key: [],
  name: "Lower"
};

const stringifiedData = qs.stringify(data);
console.log(stringifiedData);`

The result should be like this:

key=[]&name=Lower
0

There are 0 best solutions below