Skip to content

Commit

Permalink
Update Object.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yihan12 authored Dec 14, 2023
1 parent 025aca1 commit 17b2fb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions javascript/Data Types/Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ me.printIntroduction(); // My name is Mukul. Am I studying?: true
```

#### 使用ES6 Class

```javascript
class Vehicle {
constructor(name, maker, engine) {
this.name = name;
Expand All @@ -84,7 +82,10 @@ class Vehicle {

let car1 = new Vehicle('GT', 'BMW', '1998cc');

console.log(car1.name); //GT
console.log(car1.name); // 'GT'
car1.name = '123'
console.log(car1); // Vehicle {name: '123', maker: 'BMW', engine: '1998cc'}
console.log(car1.name); // '123'
```
### 对象删除
Expand Down

0 comments on commit 17b2fb8

Please sign in to comment.