function sortBooks(books){
return function hello(category){
return books.filter(book=> book.category == category)
}
}
mybooks = [{category : 'manga', name :'dragon ball'},
{category : 'manga' , name : 'doraemon'},
{category : 'science', name : 'biology'},
{category : 'science', name : 'big bang theory', level : 'difficult'}
];
filterBy = sortBooks(mybooks)
x = filterBy('manga')
console.log(x)
console.log('-----')
sortBooks2 = books => category => books.filter( book => book.category == category )
filterLah = sortBooks2(mybooks)
y = filterLah('manga')
console.log(y)
console.log('-----')
z = sortBooks2(mybooks)('science')
console.log(z)