This file works really well if you have NodeJS installed on your device. The purpose of this file is to have
the implementations of data structures and algorithms in JavaScript as a reference. You can either copy all the code in
a given file on an folder of interest and paste into Rep'l OR if node is installed, run node to the given .js
file.
To run code, simply type node
and then to the path of which code you want to run.
I want to run the code in the insertion sort. Open a the terminal in VSCode and type the following command:
node .\Algorithms\CodingPadRecords\AB-Array-Duplicate-Elements.js
And, as long as the function in question has a console log, it will print to the terminal.
-
When typing in
node
do not forget to press the 'tab' key to auto-complete. Even if its the first few words, tabing allows faster querying. -
You do not need to include the
.js
part always in the node command.