DEV Community

Discussion on: A few handy JavaScript tricks

Collapse
 
dvdty profile image
Pavel

You can replace
winner = winner ?? p;
with
winner ??= p;

Thread Thread
 
noseratio profile image
Andrew Nosenko

A good point, thanks. Though, the logical nullish assignment is fairly new (Chrome 85+, Node 15+).