let button = document.querySelector('button');
let out = document.querySelector('.out');
const a2 = [7, 6, 5];
button.onclick = () => {
let b = localStorage.setItem('a2', a2);
console.log(localStorage.getItem(b));
}
<button>Click</button>
<div class="out"></div>