finished javascript design pattern blog