DEV Community

Discussion on: Interview Qs Decoded - # 1

Collapse
 
miketalbot profile image
Mike Talbot ⭐

Just for the sake of brevity, but not improved performance:

    let [second, max] = array.sort().slice(-2)
Collapse
 
cat profile image
Cat

Daaamn that’s slick. 👌🏾👌🏾👌🏾

Collapse
 
miketalbot profile image
Mike Talbot ⭐

Yeah but I bet yours is faster :)