今日、JavaScript でコードを調べていたところ、突然、このスニペットが存在する状況に遭遇しました。
add: function (value) {
var current = null;
if (this._root === null) {
this._root = node;
} else {
current = this._root;
while (true) {
// Some code goes here.
}
}
}
条件while(true)
は常に true になります。なぜここに条件が置かれているのか、頭に浮かびません。