node BST.js
nodemon BST.js
npm install --save-dev nodemon
first we are sorting the given array and putting it in the new Set constructor to remove duplicates. The new Set will return an object so we use the spread operator (...) to convert it into an array. I recently just learned about this.
[...new Set(array.sort((a, b) => a - b))];