Last active
March 7, 2023 13:18
-
-
Save felipecesr/8ca34c6f12705c95ba8d5cb59bce1938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Printer { | |
constructor(name) { | |
this.name = name; | |
} | |
} | |
class AllInOne extends Printer { | |
constructor(name) { | |
super(name); | |
} | |
scan() { | |
return 'scanning...'; | |
} | |
} | |
function printerFunctionalities(printers) { | |
console.log('Impressoras digitalizando: '); | |
for (let printer of printers) { | |
console.log(`${printer.name} is ${printer.scan()}`); | |
} | |
} | |
let printers = [ | |
new AllInOne('HP 1'), | |
new AllInOne('HP 2'), | |
]; | |
printerFunctionalities(printers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment