ostinatos / js-playground

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS-PLAYGROUND

Collections of demo code for tasting and practicing syntax and features of javascript.

Also some algorithm solutions are included.

Build and compile by vite, the project setup and dependencies are now more simpler, and runs faster.

0. How to Run

run following command at project root:

yarn
yarn dev

1. content

javascript module

comparison between commonJS and ES6 module.

implementing design pattern using JS

singleton

using different approach to implement "singleton" pattern.

  1. static instance
  2. closure instance (not working in modern modular system)
  3. es6 class (actually the same as approach #1)

prototype vs. __proto__

understanding prototype and __proto__

ES6

destructuring

class

feature included:

  1. extends
  2. mix-ins

algorithms

  1. quicksort

2. TODO

  • typescript support
  • jest support
  • interface declaration for algorithm utilities

3. References

javascript modules

JavaScript Modules: A Beginner’s Guide

JavaScript Modules Part 2: Module Bundling

ES modules: A cartoon deep-dive

javascript the core

About

License:MIT License


Languages

Language:JavaScript 86.6%Language:TypeScript 8.4%Language:HTML 4.7%Language:CSS 0.3%