JSFiddle - React, Tailwind, and code Playground

by HemalathaThanigaivel

JavaScript

let a = 5, b = 36, c = 87;
let x = 3, y = 17, z = 100;
let aScore = 0, bScore = 0;

score(a,b,c,x,y,z);

function score(a,b,c, x,y,z) {
		if(a>=1 && a<=100 && x>=1 && x<=100) {
    	if(a>x) {
        aScore += 1;
      } else if(a<x){
           bScore += 1;
       }
    }
    
    if(b>=1 && b<=100 && y>=1 && y<=100) {
    	if(b>y) {
           aScore += 1;
       } else if(b<y){
           bScore += 1;
       }
    }
    
    if(c>=1 && c<=100 && z>=1 && z<=100) {
     if(c>z) {
           aScore += 1;
       } else if(c<z){
           bScore += 1;
       }
    }

    /* if(a>=1 && a<=100 && b>=1 && b<=100 && c>=1 && c<=100 && 
    x>=1 && x<=100 && y>=1 && y<=100 && z>=1 && z<=100) {
       if(a>x) {
        aScore += 1;
       }
       if(b>y) {
           aScore += 1;
       }
       if(c>y) {
           aScore += 1;
       } 
       if(a<x){
           bScore += 1;
       }
       if(b<y){
           bScore += 1;
       }
       if(c<z){
           bScore += 1;
       }
       console.log(aScore +" "+ bScore)
    
       //return aScore +" "+ bScore; 
    } else {
        console.log(aScore +" "+ bScore)
    } */
    
    console.log(aScore +" "+ bScore)
    
}