Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
只是为了好奇,这个函数可以写在一行中,或者至少是for产生相同输出的部分吗?
for
getById = (id)-> for e in array return e if e.id is id
小提琴演奏。
getById = (id) -> return e for e in array when e.id is id
尝试