Am Unable to Get Data from a Function ;

Now you can work with code-tags.

function getName (parameter) {
    $w("#productPage").getProduct()
    .then((product) =>{
 let productName = product.name;
 let productPrice = product.price;
 let ProductNme = productName;       //<---- what is this?
 let ProductPri = productPrice;      //<---- what is this?
 
 var details = [];

        details = [productName, productPrice];
        console.log(details);
 
 return details
    })
    .catch((error)=>{
        console.log(error);
    })
}

Why this?

let ProductNme = productName;
let ProductPri = productPrice;