remove trailing comma from cached length js snippet