I have an object with filter value I want to form a query params based on the object, pls help
object = {
emp_id: 1,
firstname: abc,
lastname: xyz,
mobile: 12345,
email: xyz@123.com
}
url = emp_id=1&firstname=abc&lastname=xyz&mobile=12345&email=xyz@123.com
for (const [key, value] of Object.entries(object)) {
url = `${key}= ${value}&`;
}
here im getting only the last value