Sending data from child window to parent window using Javascript

I have a parent popup and a child popup and I want to pass one array to the parent popup using Javascript. I tried everything but it’s not working at all. What should I do here?

The code below does nothing. I want to put the value of ret into the parent window.

 var ret = new Array(Number(txtfolioID.value), txtfolioName.value);
var opener = window.opener;
if (opener) {
  opener.setFolio(Number(txtPortfolioID.value), txtPortfolioName.value);
}

Parent aspx page

window.setFolio = function (folioID, folioName) {
  document.getElementById("txtPortfolio").value = folioName;
};

Please help