For example, if the instruction says "return person objects that are at least 20 years old", it might be more reasonable to generate:
array.filter(item => item.age >= 20)
as oppose to
array.filter(item => (item instanceof Person) && (item.age >= 20))
For example, if the instruction says "return person objects that are at least 20 years old", it might be more reasonable to generate:
array.filter(item => item.age >= 20)
as oppose to
array.filter(item => (item instanceof Person) && (item.age >= 20))