import {detectCats} from "kittydar.js";
import {detectCats, Kittydar} from "kittydar.js";
import * as module from './module';
import helloWorld from './hello-world';
function go() {
var canvas = document.getElementById("catpix");
var cats = detectCats(canvas);
drawRectangles(canvas, cats);
}
```
## class用法
- 基本语法 class A {}
- 构造器 constructor {}
- 继承 class A extends AParent {}
- super()
- 注意:类声明与函数声明不同,它不会被提升,所以先new 后class定义 会抛出异常
- 静态变量:static compare(a, b) {}
```javascript
function Vehicle(make, year) {
Object.defineProperty(this, 'make', {
get: function() { return make; }
});
Object.defineProperty(this, 'year', {
get: function() { return year; }
});
}
Vehicle.prototype.toString = function() {
return this.make + ' ' + this.year;
}
var vehicle = new Vehicle('Toyota Corolla', 2009);
console.log(vehicle.make);
vehicle.make = 'Ford Mustang';
console.log(vehicle.toString())