Tag how to use slice in JavaScript