<!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. TI CC2541的中断优先级设置.

    实际看到的中断优先级设置是这样的:

  2. C# csv 操作类

    using System.Data; using System.IO; using System.Text; namespace YanZhiwei.DotNet2.Utilities.Common ...

  3. WIN7(VISTA)系统无法上网问题排查方法

    WIN7(VISTA)系统无法上网问题排查方法 一.无法通过DHCP自动获取到IP 1. 确认正确配置路由器的DHCP功能 a.一般租期建议设置为1-3小时,推荐设置1小时. b.DHCP地址池不要和 ...

  4. 打开开源项目总得.md文件

    google了一些: 78 Tools for Writing and Previewing Markdown  http://mashable.com/2013/06/24/markdown-too ...

  5. iOS:UITableView 方法 属性

    参考:https://developer.apple.com/library/iOS/documentation/UIKit/Reference/UITableView_Class/Reference ...

  6. win2003 服务器安全设置详细介绍

    第一步:一.先关闭不需要的端口  我比较小心,先关了端口.只开了3389 21 80 1433(MYSQL)有些人一直说什么默认的3389不安全,对此我不否认,但是利用的途径也只能一个一个的穷举爆破, ...

  7. 超文本标记语言(HTML)

    超文本标记语言(HyperText MarkUp Language,HTML) HTML是用来制作网页的标记语言,HTML不需要编译,直接由浏览器解析: HTML文件是一个文本文件,包含了一些HTML ...

  8. sass初步认识2

    sass可以使用变量,采用 $ 来进行变量声明,格式为: $highlight-color:#f90;(声明方式和css属性声明类似.使用的变量名可以更加语义化) 与js分为全局变量和局部变量类似,s ...

  9. 关闭用miniUI打开的窗口

    miniUI打开的窗口用window.close关闭无效, 应该用window.CloseOwnerWindow();

  10. YTU 2987: 调整表中元素顺序(线性表)

    2987: 调整表中元素顺序(线性表) 时间限制: 1 Sec  内存限制: 2 MB 提交: 1  解决: 1 题目描述 若一个线性表L采用顺序存储结构存储,其中所有元素都为整数.设计一个算法,将所 ...