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 :
Syntax is wrong, class should be in lowercase:
class Addition {
constructor () {
}
add (a = 1, b = 1) {
console.log(a+b)
}
}