Sharing variables between the same file

All my 5 html files that all go to each other using links and share the same javascript script <script src="indexJS.js"></script> In the javascript file I have the following

let shoppingCart = []

function reply_click(clicked_id)
{
    shoppingCart.push(clicked_id);
    console.log(shoppingCart);
}

Basically when I click a button, I get the id of the button and then add it to an array. What I want to happen is when I go to another file, it says that shoppingCart array between files. Right now every time I go to a new HTML file, the shoppingCart array resets.

I DON’T want to use any other languages except javascript. No node or anything please, I’m not sure if its possible though.