<!DOCTYPE html>
<html>
<h1> escripts js</h1>
<script>
// classes em javascript
class soma_sub {
constructor(x, y){
this.x = x;
this.y = y;
}
soma(){
return this.x + this.y;
}
}
// aplicando a classe
result = new soma_sub(5,7);
document.write(result.soma());
</script>
<body>
</body>
</html>