Skip to content

An interactive demo about javascript type coercion in '==' (loosy equalling operator)

Notifications You must be signed in to change notification settings

nendonerd/coercion-visual-demo

Repository files navigation

Coercion Visual Demo

this is an interactive demo about javascript type coercion in '==' (loosy equalling operator) It follows the complicated ECMA spec coercion rules to show every step of type conversions happened in a coercion.

Running in Cloud

Warning: I have only test my automation script on Google Cloud Platform. If you're running them on any other host, I'm assuming you know how to modify bash script to fix potential failures.

How to deploy:

create a new vm that runs latest debian, then ssh into it and paste the following

wget https://raw.githubusercontent.com/nendonerd/coercion-visual-demo/master/deploy.sh
sudo chmod 777 deploy.sh
./deploy.sh

deploy.sh can accept two OPTIONAL parameters, ./deploy.sh <name> <repo>

After finished installation, it will show your external ip address at the bottom, copy it and paste into a browser, have fun!

How to update:

cd cocercion
sudo chmod 777 update.sh
./update.sh

Running in local

just simply open index.html with a browser

Or run in inside vscode locally with quokka.js pro plugin

Shift + Cmd + P -> quokka start

Todo list:

  • add quick tests to frontend
  • unit testing
  • fix JSON.stringify(NaN) => null bug
  • fix double result bug
  • add a domain for the example
  • better css visuals (type highlighting)
  • node interface

About

An interactive demo about javascript type coercion in '==' (loosy equalling operator)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published