Rock paper scissors score

Hi, I am new to Javascript. I have been trying to do a rock , paper and scissors problem where I need to keep track of the score after playing 5 rounds with the computer (and announce the winner). I honestly need help with the scoring part (I tried a lot of things but am not able to see the issue), and forgive me if the code is not efficient, I have been trying to use what I have learned thus far and have not had any luck with the last part. I am thankful in advance for any help I can get with this problem.

function computerPlay() {
   let x=Math.floor(Math.random() *3);
       case 0:
       return "Rock";
       case 1:
       return "Paper";
       case 2:
       return "Scissors";
function playRound(playerselection, computerselection){
if (playerselection.toLowerCase()===computerselection.toLowerCase()){
    return "It is a tie";
else if (playerselection.toLowerCase()==="rock" && computerselection.toLowerCase()==="paper"){
    return "you lose, paper defeats rock";
else if (playerselection.toLowerCase()==="paper" && computerselection.toLowerCase()==="scissors") {
    return "you lose, scissors defeat paper";
else if (playerselection.toLowerCase()==="scissors" && computerselection.toLowerCase()==="rock"){
    return "you lose, rock defeats scissors"
else if (playerselection.toLowerCase()==="rock" && computerselection.toLowerCase()==="scissors"){
    return "you win, rock defeats scissors";
else if (playerselection.toLowerCase()==="paper" && computerselection.toLowerCase()==="rock") {
    return "you win, paper defeats rock";
else if (playerselection.toLowerCase()==="scissors" && computerselection.toLowerCase()==="paper"){
    return "you win, scissors defeat paper"

let myPoints=0;
let comPoints=0;
function game() {
    let i=0;
    for (;i<5;i++) {
        let x=prompt("choose your weapon: ");
        if (y.slice(0,7).toLowerCase==="you win"){
    else if (y.slice(0,8).toLowerCase==="you lose") {
let a="you win, rock beats scissors"
if (a==="YOU WIN"){

Just create a variable called let score; at the top of the file and change it as you go. Something like score++

Thank you. I insisted a little more and it has finally worked. I am thankful for your help.