嗨,我有一个类型为Book对象的数组,并且我试图返回按tags属性过滤的所有Books 。例如
var books = [
(title = "The Da Vinci Code", tags = "Religion, Mystery, Europe"),
(title = "The Girl With the Dragon Tatoo", tags = "Psychology, Mystery, Thriller"),
(title = "Freakonomics", tags = "Economics, non-fiction, Psychology")
}]
Run Code Online (Sandbox Code Playgroud)
并且我想找到与标记相关的书Psychology,(title = "The Girl With the Dragon Tatoo", tag = "Psychology, Mystery, Thriller")并且(title = "Freakonomics", tags = "Economics, non-fiction, Psychology"),我该怎么做?