Skip to content

Commit 84a9580

Browse files
authored
Create 10Class&Objects.js
1 parent ad6a623 commit 84a9580

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

OOPS/10Class&Objects.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class result{
2+
name;
3+
marks;
4+
constructor(name,marks=0){
5+
this.name=name;
6+
this.marks=marks;
7+
}
8+
total(num){
9+
this.marks+=num;
10+
11+
};
12+
let a=new result('shyama',100);
13+
a.total(200);
14+
console.log(a);

0 commit comments

Comments
 (0)