I have an object like this:
MyLibrary {
books:
[ Book {
bookType: 'romance'
}
]
}
Book is a class.
I would like to write a test to check if books contain an object that is an instance of Book. I was expecting to use something like MyLibrary.books.indexOf('Book') but it returns -1 even when Book exist.
.someelements inbooksare aninstanceofBook…