sparse and dense polynomials code bricks for JavaScript