LocalStorage tidak didefinisikan
if (typeof window !== 'undefined') {
localStorage.setItem('myCat', 'Tom');
}
Grieving Gharial
if (typeof window !== 'undefined') {
localStorage.setItem('myCat', 'Tom');
}