博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
js实现栈
阅读量:7094 次
发布时间:2019-06-28

本文共 375 字,大约阅读时间需要 1 分钟。

function Stack(){}Stack.prototype.push = function (v){    this.head = {        v:v,        next:this.head    };};Stack.prototype.pop = function () {    if(this.head.next !== undefined){        var top = this.head.v;        this.head = this.head.next;        console.log(top);        return top;    }else{        console.log(this.head.v);        return this.head.v;    }};复制代码

转载地址:http://wjaql.baihongyu.com/

你可能感兴趣的文章
老男孩教育决心书
查看>>
基于LVS实现负载均衡
查看>>
系统集成知识点整理(六)人力资源管理
查看>>
httpclient使用
查看>>
开发部署测试经常用到的linux命令
查看>>
使用windows 远程KALI3.0
查看>>
Sqoop 1.4.6 安装
查看>>
mysql数据恢复
查看>>
编码二进制数据和文本互相转换的控件工具Xceed Binary Encoding Library
查看>>
天才人物的最完美范例
查看>>
我的友情链接
查看>>
linux开发笔记
查看>>
新手如何快速入门node.js
查看>>
如何给容器服务的Docker增加数据盘
查看>>
配置WordPress回收站功能
查看>>
我收集的资料网站
查看>>
Java基础-第2天
查看>>
有一种爱叫白头偕老
查看>>
linux返回码 $?
查看>>
jQuery formvalidator插件 API帮助文档
查看>>