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
you can use
var currentNode = queue.shift();
so no need to get the first value and .shift at the end of while
The Joy of discovery is one of the best things about being a software developer ~ Eric Elliott