I want to form an object based the keys from another object and set values to empty string;
const availableList = [
{id: 1, key: 'emp_id'},
{id: 2, key: 'firstname'},
{id: 3, key: 'lastname'},
{id: 4, key: 'mobile'},
{id: 5, key: 'email'},
]
availableList .forEach(key => result [key] = availableList [key]);
Expected output:
result = {
emp_id: '',
firstname: '',
lastname: '',
mobile: '',
email: ''
}