LB-WIFI-001 Wireless AC adapter
{
let items = JSON.parse(localStorage.getItem('recentlyViewedProducts') || '[]');
// If the product already exists we first remove it
if (items.includes(11324850929982)) {
items.splice(items.indexOf(11324850929982), 1);
}
items.unshift(11324850929982);
// Then, we save the current product into the local storage, by keeping only the 18 most recent
try {
localStorage.setItem('recentlyViewedProducts', JSON.stringify(items.slice(0, 18)));
} catch (error) {
// Do nothing, this may happen in Safari in incognito mode
}
})();