#JavaScriptで配列の最後の値を取得する

Array.at()を使います。

[1, 2, 3].at(-1)
// 3