Add build script for JS and TS codes.

This commit is contained in:
krahets
2023-02-08 19:45:06 +08:00
parent 22b7d65d20
commit 05f0054005
28 changed files with 227 additions and 2217 deletions

View File

@ -4,7 +4,7 @@
* Author: IsChristina (christinaxia77@foxmail.com)
*/
/* 随机访问元素 */
/* 随机返回一个数组元素 */
function randomAccess(nums) {
// 在区间 [0, nums.length) 中随机抽取一个数字
const random_index = Math.floor(Math.random() * nums.length);

View File

@ -44,7 +44,7 @@ class LinkedListStack {
/* 访问栈顶元素 */
peek() {
if (!this.#stackPeek)
throw new Error("栈为空");
throw new Error("栈为空");
return this.#stackPeek.val;
}