function sum(a,b){
    const add = a+b;
    if(add >= 10){
        return "error";
    }
    return add;
}

const result1 = sum(1,2);
console.log(result1);

const result2 = sum(1,11);
console.log(result2);