JavaScript · Senior · Question 42 of 75
How do you sync data between tabs of the same site?
- ✓Correct answer: With
BroadcastChannelor thestorageevent - 2With
window.opener, which all tabs of the same site have - 3With
sessionStorage- it's shared by all tabs of the same site
Explanation
BroadcastChannel('app') delivers messages to all contexts of the same origin (tabs, iframes, workers). The storage event fires in other tabs when localStorage is written. sessionStorage is isolated per tab.