Write `trackPrevious(history, nextValue)` returning `[newHistory, previousValue]` where `newHistory` is `history` with `nextValue` appended, and `previousValue` is the last element of the original `history` (or `undefined`).
Required in your answer: history.length
Transpiled, then run in a sandbox
function trackPrevious(history, nextValue) {
// TODO
}