code2021-l
Version:
前端自定义工具
29 lines (24 loc) • 753 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>栈_测试</title>
</head>
<body>
<script src="../../../node_modules/atguigu-utils/dist/atguigu-utils.js"></script>
<script src="../../../dist/190719-utils.js"></script>
<script>
const stack = new aUtils.Stack()
stack.push(1)
stack.push('abc')
stack.pop()
const stack2 = new aUtils.Stack()
stack2.push(true)
stack2.push('atguigu')
console.log(stack.peek(), stack.size(), stack.isEmpty())
console.log(stack2.peek(), stack2.size(), stack2.isEmpty())
</script>
</body>
</html>