[lib] [web] Use slice(0, -1) instead of slice(0, ...length - 1)
Summary: Noticed some instances of slice() being called with the length property of the array that was being sliced instead of the more concise syntax using negative indices.
Test Plan: N/A, but checked to make sure slice() functions the same with the negative index and when called with its positive counterpart (...length - 1, for example).
Reviewers: atul, palys-swm
Reviewed By: atul
Subscribers: ashoat, Adrian
Differential Revision: https://phab.comm.dev/D4316