I have below object and want to boolean flag true if new value different form old value and false if not
Original object:
{
userName: '[email protected]',
email: '[email protected]',
firstName: 'Naresh',
lastName: 'Kumar',
oldEmail: '[email protected]',
oldFirstName: 'Rakesh',
oldLastName: 'Kumar'
}
After transformation:
{
userName: '[email protected]',
email: '[email protected]',
firstName: 'Naresh',
lastName: 'Kumar',
isFirstNameChanged: true,
isEmailChanged: true,
isFirstNameChanged: false,
oldEmail: '[email protected]',
oldFirstName: 'Rakesh',
oldLastName: 'Kumar'
}
Is there any way to do it in lodash?