chen_CHEN976 level
获赞
682
粉丝
7
关注
5
看过 TA
28
nothing
2018
前端工程师
IP属地:未知
暂未填写个人简介
私信
关注
2017-09-19 11:05
已编辑
nothing 前端工程师
0 点赞 评论 收藏
分享
2017-09-18 18:01
已编辑
nothing 前端工程师
用JS实现一个英雄类HEro ,可以接受以下方式调用   hero("aaa")   输出 hi this is aaa   hero("aaa").kill(1).recover(30)   输出 hi this is aaa   kill 1 bug(1s所以不是bugs)   recover30 bloods   hero("aaa").sleep(10).kill(2)   输出 hi this is aaa   暂停10秒   kill 2 bugs       一开始我用的构造函数+原型写了一个类貌似不对   有没有其他的解决方案?   还有sleep10如何实现?用一个空的whi...
好好学java:类似JQ的链式调用 ;(function(){ window.Hero = function(name, num, bloods){ console.log(this.name); return new _Hero(name, num, bloods); }; function _Hero(name, num, bloods) { this.name = name; this.num = num; this.bloods = bloods; return this; }; _Hero.prototype = { constructor : _Hero, kill: function () { if (this.num === 1) { console.log("kill " + this.num + " bug"); } else { console.log("kill " + this.num + " bugs"); } return this; }, recover: function () { if (this.bloods === 1) { console.log("recover " + this.bloods + " blood"); } else { console.log("recover " + this.bloods + " bloods"); } return this; }, sleep: function () { setTimeout((function () { // 等待 console.log(' '); })(), 10000); return this; } }; })(); Hero("aaa").sleep(10).kill(2);
0 点赞 评论 收藏
分享
2017-09-18 16:38
已编辑
nothing 前端工程师
RI  有dalao分享答案吗 嘻嘻   做完了不想就这么放着~~~
美团内推助手:登录态去看session机制。emitter类去看backbone源码实现
投递欢聚集团等公司10个岗位
0 点赞 评论 收藏
分享
2017-09-18 10:24
已编辑
nothing 前端工程师
rt   没收到改时间的短信 求告诉。。
alice-w:【牛客网】同学你好,迅雷邀你09月19日 19时00分参加在线笔试,如未收到邮件,可关注微信服务号:校招小管家随时查询,如需更改考试时间,请在18号上午10点前联系校招HR韩梅梅,微信号xunleicampus,更改时间后另外发送笔试通知,之前收到的链接将失效,请知晓,祝你笔试顺利。 复制短信上的,你试试
投递迅雷等公司10个岗位
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务