<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script>
window.onload=function(){
/*
1.
(function(){
alert(typeof(arguments));
})();
自执行函数,结果为object
*/
/*2.
var f = function g(){ return 23; };
alert(typeof g());*/
//g只能在内部调用,结果为 g is not undefined /*3.(function(x){
delete x;
return x;
})(1);*/
//delete只能删除某个函数下的属性,不能删除变量以及参数,这里的x为形参,结果为1 /*4.
var y = 1, x = y = typeof x;
alert(x);
因为typeof返回的是字符串,并且表达式从右向左计算,因此结果为"undefined"*/ /*5.
(function f(f){
return typeof f();
})(function(){ return 1; });
自执行函数,把1传给f,结果number*/ /*
6.
var foo = {
bar: function() { return this.baz; },//this指向foo.bar,但其实是window
baz: 1
};
(function(){
return typeof arguments[0]();
})(foo.bar);//结果为undefined*/ /*7.
var foo = {
bar: function(){ return this.baz; },
baz: 1
}
typeof (f = foo.bar)();
;*/ /*8.
var f = (function f(){ return "1"; }, function g(){ return 2; })();
alert(typeof f);
//分组选择符,返回最后面的那个值*/ /*9.
var x = 1;
if (function f(){}) {
x += typeof f;//1+undefined字符串连接
}
x;*/ /*10.
var x = [typeof x, typeof y][1];
typeof typeof x;//返回字符串string*/ /*11.
(function(foo){
return typeof foo.bar;
})({ foo: { bar: 1 } });//只有foo一个属性,返回undefined*/ /*12.
(function f(){//函数声明预解析,结果为2,覆盖前面的1和2
function f(){ return 1; }
return f();
function f(){ return 2; }
})();*/ /*13.
function f(){ return f; }
new f() instanceof f;//f()变成了f对象,结果为false*/ /*14.
with (function(x, undefined){}) length;
//计算函数的长度,即参数的个数,结果为2*/
}
</script>
</head>
<body>
</body>
</html>

网址:http://perfectionkills.com/

Perfection Kills的更多相关文章

  1. JavaScript 风格指导(Airbnb版)

    JavaScript 风格指导(Airbnb版) 用更合理的方式写 JavaScript 原文 翻译自 Airbnb JavaScript Style Guide . 目录 类型 引用 对象 数组 解 ...

  2. Airbnb JavaScript Style Guide

      Airbnb JavaScript Style Guide() { 用更合理的方式写 JavaScript    ES5 的编码规范请查看版本一,版本二. 翻译自 Airbnb JavaScrip ...

  3. HDOJ 1323 Perfection(简单题)

    Problem Description From the article Number Theory in the 1994 Microsoft Encarta: "If a, b, c a ...

  4. (25)Teach girls bravery, not perfection

    https://www.ted.com/talks/reshma_saujani_teach_girls_bravery_not_perfection/transcript00:12So a few ...

  5. (12)We should aim for perfection — and stop fearing failure

    https://www.ted.com/talks/jon_bowers_we_should_aim_for_perfection_and_stop_fearing_failure/transcrip ...

  6. poj 1528 Perfection

    题目链接:http://poj.org/problem?id=1528 题目大意:输入一个数n,然后求出约数的和sum,在与这一个数n进行比较,如果sum>n,则输出ABUNDANT,如果sum ...

  7. Kills all phantomjs instances, disregard of their origin python关闭进程

    Python/Linux quit() does not terminate PhantomJS process · Issue #767 · SeleniumHQ/selenium https:// ...

  8. Gym 100703I---Endeavor for perfection(尺取)

    题目链接 http://codeforces.com/problemset/gymProblem/100703/I Description standard input/outputStatement ...

  9. CF GYM 100703I Endeavor for perfection

    题意:有n个学习领域,每个领域有m个课程,学习第i个领域的第j个课程可以获得sij个技能点,在每个领域中选择一个课程,要求获得的n个技能点的最大值减最小值最小,输出符合要求的策略. 解法:尺取法.将课 ...

随机推荐

  1. 安装LAMP

    1.首先打开命令行,获得最新的软件包 sudo apt-get install update 2.安装MySQL数据库 sudo apt-get install mysql-server mysql- ...

  2. Akka.NET

    https://github.com/akkadotnet Akka是什么? 可扩展的分布式实时事务处理 编写正确的并发,容错和可扩展的应用程序是太难了.大多数时候,这是因为我们使用了错误的工具和错误 ...

  3. spring命名空间不需要版本号

    为什么dubbo启动没有问题? 这篇blog源于一个疑问: 我们公司使了阿里的dubbo,但是阿里的开源网站http://code.alibabatech.com,挂掉有好几个月了,为什么我们的应用启 ...

  4. umask:遮罩码

    查看umask:umask 创建文件:-umask 文件默认不能具有执行权限 创建目录:-umask 设置umask:umask 0022 生效访范围:当前shell

  5. Codeforces 733C:Epidemic in Monstropolis(暴力贪心)

    http://codeforces.com/problemset/problem/733/C 题意:给出一个序列的怪兽体积 ai,怪兽只能吃相邻的怪兽,并且只有体积严格大于相邻的怪兽才能吃,吃完之后, ...

  6. Floyd-Warshall算法,简称Floyd算法

    Floyd-Warshall算法,简称Floyd算法,用于求解任意两点间的最短距离,时间复杂度为O(n^3). 使用条件&范围通常可以在任何图中使用,包括有向图.带负权边的图. Floyd-W ...

  7. jquery 判断checkbox是否为空的三种方法

    //方法一: if ($("#checkbox-id")get(0).checked) { // do something } //方法二:也适用于单选按钮 if($('#chec ...

  8. python请求java Selenium Webdriver

    下载jar包: selenium-server-standalone-2.44.0.jar 运行jar包: java -jar selenium-server-standalone-2.44.0.ja ...

  9. ReentrantLock的原理学习

    转载:https://my.oschina.net/andylucc/blog/651982 摘要 提到JAVA加锁,我们通常会想到synchronized关键字或者是Java Concurrent ...

  10. asp.net OnInit、OnLoad、Page_Load、Page_Init父子页面执行顺序探究

    本次探究page页面加载的时候,它们的执行顺序 BasePage public class BasePage : Page { public string BaseName { get; set; } ...