mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 02:05:08 +08:00
added the let-statment to some methods
This commit is contained in:
@ -81,7 +81,7 @@ var Tree = (function () {
|
|||||||
|
|
||||||
// Start by searching the root
|
// Start by searching the root
|
||||||
Tree.prototype.search = function (val) {
|
Tree.prototype.search = function (val) {
|
||||||
var found = this.root.search(val);
|
let found = this.root.search(val);
|
||||||
if (found === null) {
|
if (found === null) {
|
||||||
console.log(val + " not found");
|
console.log(val + " not found");
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ var Tree = (function () {
|
|||||||
|
|
||||||
// Add a new value to the tree
|
// Add a new value to the tree
|
||||||
Tree.prototype.addValue = function (val) {
|
Tree.prototype.addValue = function (val) {
|
||||||
var n = new Node(val);
|
let n = new Node(val);
|
||||||
if (this.root == null) {
|
if (this.root == null) {
|
||||||
this.root = n;
|
this.root = n;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user