'Javascript class giving sintax error from it being ok [closed]

i am uisang this code:

Class Addition {
    constructor () {
        
    }

    add (a = 1, b = 1) {
        console.log(a+b)
    }
}

but it geeve aan error

Uncaught SyntaxError: Unexpected identifier


Solution 1:[1]

Syntax is wrong, class should be in lowercase:

class Addition {
    constructor () {
        
    }

    add (a = 1, b = 1) {
        console.log(a+b)
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Adison Masih