This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用速度最优的代码输出一个带有细线表格的乘法口诀表。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
先不要运行,在回复中写出以下的结果: | |
1. var a; typeof a; | |
2. var s; s++; | |
3. !!'false'; | |
4. !!undefined; | |
5. typeof -Infinity; | |
6. 10 % '0'; | |
7. undefined == null; | |
8. typeof '2E+2'; | |
9. a = 3e+3; a++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 分别用原生js,jquery实现dom的curd。就是节点的增加、删除、修改、选择、移动、复制。 | |
2. 用原生js实现类似jquery的append,prepend,after,before,wrap,unwra多种位置的插入操作。 | |
只是实现位置的插入,并不是完整的jquery的功能。 | |
比如: | |
append : <div id="div"><span>原有节点</span>待插入的节点<div> | |
prepend : <div id="div">待插入的节点<span>原有节点</span><div> | |
after : <div id="div"><span>原有节点</span><div>待插入的节点 | |
before : 待插入的节点<div id="div"><span>原有节点</span><div> | |
wrap : <div data-title="待包裹节点"><div id="div"><span>原有节点</span><div></div> | |
unwrap : 删除包裹节点后:<div id="div">待插入的节点<span>原有节点</span><div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用js如何精确的计算出前端页面渲染加载时间? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
最近传疯了的一道测试题,据说IQ125以上的人才知道答案 | |
9 = 72 | |
8 = 56 | |
7 = 42 | |
6 = 30 | |
5 = 20 | |
3 = ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
我在向美女Mary索要QQ号时,她告诉我这样的规则: | |
首先将第1个数删除,紧接着将第2个数放到这串数的末尾, | |
再将第3个数删除并将第4个数放到这串数的末尾, | |
再将第5个数删除,一直到最后一个数,将最后的一个数也删除。 | |
按照刚才删除的顺序,把这些删除的数按顺序串连起来就是Mary的QQ号。 | |
比如这个qq号是:123456 删除后连起来的数是: | |
1 | |
34562 | |
3 | |
5624 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
如何获取URL地址栏参数? | |
如:https://gist.github.com/send.php?name=jikey&age=30&lan=js; | |
getParam(); -> { name : jikey, age : 30, lan : js} | |
getParam('name') -> jikey | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
请把“[img111],[img222]”替换为“<img src="111.jpg"/>,<img src="222.jpg"/>”。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用代码实现一个毫秒级的倒计时,且可以多处调用。 | |
格式如:离建群三周年还有: 30天-23小时-40分钟-58秒-32毫秒 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
将任意数字的金额,转换成汉字大写的形式。 | |
如:1234.50 -> 壹仟贰佰叁拾肆圆伍角。 | |
壹、贰、叁、肆、伍、陆、柒、捌、玖、拾、佰、仟、万、亿、元、角、分、零、整。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |