Skip to content

Instantly share code, notes, and snippets.

@JoseRubensVeiga
Last active April 24, 2020 12:34
Show Gist options
  • Save JoseRubensVeiga/c35e66786e427a9f5d4dc9566f1005eb to your computer and use it in GitHub Desktop.
Save JoseRubensVeiga/c35e66786e427a9f5d4dc9566f1005eb to your computer and use it in GitHub Desktop.
class Car {
cor = 'verde';
}
const car1 = new Car();
const car2 = {
cor: 'verde',
}
function showCar(car: Car) {
console.log(car);
}
showCar(car1); // OK , pois car1 é uma instancia da classe Car
showCar(car2); // OK, pois car2 tem todos os atributos e métodos da classe Car
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment