testing javascript function