Skip to content

Instantly share code, notes, and snippets.

@jikeytang
Last active August 29, 2015 14:03
Show Gist options
  • Save jikeytang/20049967c535cc838f05 to your computer and use it in GitHub Desktop.
Save jikeytang/20049967c535cc838f05 to your computer and use it in GitHub Desktop.
[ Javascript ] - 20140707-题目1
先不要运行,在回复中写出以下的结果:
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++;
10. typeof ('2'+'1'); typeof ('2'-'1');
11. 1.toString();
12. typeof typeof 1;
PS:
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。
```javascript
// you code
```
2. 粘贴代码时请使用shift+tab,缩进前面的空白。
@tickwudi
Copy link

tickwudi commented Jul 7, 2014

1. var a; typeof a;=>undefined
2. var s; s++;=>NaN 
3. !!'false';=>true
4. !!undefined;=>false
5. typeof -Infinity;=>NaN=》number
6. 10 % '0';=>NaN
7. undefined == null;=>false=>true
8. typeof '2E+2';=>String=>string
9. a = 3e+3; a++;=>不知=>3001
10. typeof ('2'+'1'); typeof ('2'-'1');=>不知=》string,number
11. 1.toString();=>"1"=>不知=》报错
12. typeof typeof 1;=>string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment