Chewy Interview Question

create SpringCleaning System with two piles. 1. keep 2. throwaway and methods to add, remove, display all items in piles.

Interview Answer

Anonymous

Dec 2, 2020

Created a function with an object that has two piles as arrays. added three methods(add, remove, displayAll)using prototype inheritance. I told him we can create using ES6 class as well. there are many ways to solve this.