I decided to write an article about implementing common data structures. The focus is mainly on coding in javascript rather than on theoretical ex...
For further actions, you may consider blocking this person and/or reporting abuse
The easiest way to run the examples is parceljs.
Create an index.html in the same directory. Include your index.js in it like this.
Then install parcel with npm globally ->
npm i -g parcel-bundler
After that, you can type "parcel index.html" in the console and it will be available on localhost:1234 and you can check the output in the console of the browser.
Parcel is a zero-configuration web application bundler by the way.
If you want to run it with node, you can do
node ./index.js
in the console, but it will fail because of the "import { blabla } from "something" syntax.You can change the export statements to the following (example):
and then import it in your index.js
const { BinarySearchTree} = require("./BinarySearchTree")
If you don't want to change the code, you can setup babel with node as well.
(this is babel6, for babel7 please check the official documentation)
step1:
npm -i babel-cli babel-preset-env
step2: create a
.babelrc
file that looks like this:step3: run your index.js with the following command:
./node_modules/.bin/babel-node index.js
Cool, I use parcel, thanks Braun really.
Really cool! Thanks for sharing.
I think there's a bug in the setter of the HashTable:
Could you tell me how to run? Node version?
Hey chenge, please check my comment above. It should help you out.