davidasync
1 min readApr 13, 2018

--

you can use

var currentNode = queue.shift();

so no need to get the first value and .shift at the end of while

--

--

davidasync
davidasync

Written by davidasync

The Joy of discovery is one of the best things about being a software developer ~ Eric Elliott

No responses yet