javascript function parser