Podany jest poniższy skrypt:
class Food { constructor(name) { this.name = name; } } class Fruit extends Food{ constructor(name) { super(name); } } let fruit_1 = new Fruit("Banana");
Jaki będzie wynik poniższych wyrażeń?
fruit_1 instanceof Fruit fruit_1 instanceof Food
Wybierz odpowiedź:
-
fruit_1 instanceof Fruit => false fruit_1 instanceof Food => false
-
fruit_1 instanceof Fruit => true fruit_1 instanceof Food => true
-
fruit_1 instanceof Fruit => true fruit_1 instanceof Food => false
Subscribe
Login
0 komentarzy