Solving some cool problems using JS