会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Stay foolish, stay hungry!
To change ! To do ! To realize !
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
23
下一页
2017年6月18日
201706180310_《 Javascript (ES6)给变量一个hash串》
摘要: (() => { //UUID Fn-1 S4 = () => { return (((1+Math.random())*0x10000)|0).toString(16).substring(1); }; //UUID Fn-2 guid = () => { let me = this; return (me.S4()+m...
阅读全文
posted @ 2017-06-18 03:12 Coca-code
阅读(669)
评论(0)
推荐(0)
2017年4月22日
201704221048_《ES6模板字符串》
摘要: const tmpl = addrs => ` ${addrs.map(addr => ` ${addr.first} ${addr.last} `).join("")} `; const data = [ { first: "", last: "Bond" }, { first: "Lars", last: "...
阅读全文
posted @ 2017-04-22 10:48 Coca-code
阅读(150)
评论(0)
推荐(0)
2017年3月24日
201702241015——《关于Javascript的__proto__》
摘要: var arr = []; Object.getPrototypeOf(arr); 等效率于:arr.__proto__
阅读全文
posted @ 2017-03-24 10:17 Coca-code
阅读(148)
评论(0)
推荐(0)
2017年2月11日
201702112331_《js缺陷-数值比较补救》
摘要: const EPSILON = Math.pow(2, -53); //1.1102230246251565e-16 function epsEqu(x,y) { return Math.abs(x - y) < EPSILON; } epsEqu(0.1+0.2, 0.3) //true
阅读全文
posted @ 2017-02-11 23:32 Coca-code
阅读(126)
评论(0)
推荐(0)
2017年2月5日
201702051001_《JS替换全部》
摘要: var str = 'yinMinFeng'; var result = str.replace(/n/g,"ss"); //注意那个'g'全局 console.log(result); //yissMissFessg
阅读全文
posted @ 2017-02-05 10:04 Coca-code
阅读(113)
评论(0)
推荐(0)
2016年12月2日
201612020940——《Javascript深拷贝》
摘要: 学习Js是一条长路,不能仅仅限于网页动效
阅读全文
posted @ 2016-12-02 09:42 Coca-code
阅读(118)
评论(0)
推荐(0)
2016年3月10日
201603102057_《Javascript之观察者模式(模块间通讯)》
摘要: <!-- Html代码--> <button type="button" id="count"> 点我</button> <div id="show"></div> /*********************** * Javascript代码 * ***********************/
阅读全文
posted @ 2016-03-10 21:04 Coca-code
阅读(251)
评论(0)
推荐(0)
2016年3月6日
201603061528_《Javascript交换两个变量值(不借用第三变量)》
摘要: /*================================= @DESC:Exchange two value without third var. @AUTHOR: Not me. @DATE:2016-3-6 15:33 ================================
阅读全文
posted @ 2016-03-06 15:35 Coca-code
阅读(310)
评论(0)
推荐(0)
201603061520_《Javascript生成随机字符串函数(可用于加密)》
摘要: function generateRandomString(len) { var randomString = ""; for (; randomString .length < len; randomString += Math.random().toString(36).substr(2));
阅读全文
posted @ 2016-03-06 15:23 Coca-code
阅读(212)
评论(0)
推荐(0)
2016年2月17日
201602171037_《Js地理位置(摘)》
摘要: JS新API标准 地理定位(navigator.geolocation) 在新的API标准中,可以通过navigator.geolocation来获取设备的当前位置,返回一个位置对象,用户可以从这个对象中得到一些经纬度的相关信息。 navigator.geolocation的三个方法: 1. get
阅读全文
posted @ 2016-02-17 10:39 Coca-code
阅读(207)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
23
下一页
公告