I have two arrays with the same length.
array1 = ['title', 'details', 'price', 'discount'];
array2 = ['product name', 'product details', 200, 20];
Want to convert them into one object like following
newObject = {
title: 'product name',
details: 'product details',
price: 200,
discount: 20
}
How to do that?