javascript solutions