Reviewed code using JSlint