Perfection Kills
<!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的更多相关文章
- JavaScript 风格指导(Airbnb版)
JavaScript 风格指导(Airbnb版) 用更合理的方式写 JavaScript 原文 翻译自 Airbnb JavaScript Style Guide . 目录 类型 引用 对象 数组 解 ...
- Airbnb JavaScript Style Guide
Airbnb JavaScript Style Guide() { 用更合理的方式写 JavaScript ES5 的编码规范请查看版本一,版本二. 翻译自 Airbnb JavaScrip ...
- HDOJ 1323 Perfection(简单题)
Problem Description From the article Number Theory in the 1994 Microsoft Encarta: "If a, b, c a ...
- (25)Teach girls bravery, not perfection
https://www.ted.com/talks/reshma_saujani_teach_girls_bravery_not_perfection/transcript00:12So a few ...
- (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 ...
- poj 1528 Perfection
题目链接:http://poj.org/problem?id=1528 题目大意:输入一个数n,然后求出约数的和sum,在与这一个数n进行比较,如果sum>n,则输出ABUNDANT,如果sum ...
- Kills all phantomjs instances, disregard of their origin python关闭进程
Python/Linux quit() does not terminate PhantomJS process · Issue #767 · SeleniumHQ/selenium https:// ...
- Gym 100703I---Endeavor for perfection(尺取)
题目链接 http://codeforces.com/problemset/gymProblem/100703/I Description standard input/outputStatement ...
- CF GYM 100703I Endeavor for perfection
题意:有n个学习领域,每个领域有m个课程,学习第i个领域的第j个课程可以获得sij个技能点,在每个领域中选择一个课程,要求获得的n个技能点的最大值减最小值最小,输出符合要求的策略. 解法:尺取法.将课 ...
随机推荐
- ServiceStack.Redis 之 IRedisTypedClient 04_转
IRedisTypedClient IRedisTypedClient类相当于IRedicClient的强类型版,其方法与属性大多数与IRedisClient类似. 它支持在Redis中使用Linq查 ...
- 13、mysql/触发器
1. mysql mysql基础 1)mysql存储结构: 数据库 -> 表 -> 数据 sql语句 2)管理数据库: 增加: create database 数据库 default ...
- ACM题目————二叉树的遍历
一.二叉树的后序遍历: 题目描述 给定一颗二叉树,要求输出二叉树的深度以及后序遍历二叉树得到的序列.本题假设二叉树的结点数不超过1000 输入 输 入数据分为多组,第一行是测试数据的组数n,下面的n行 ...
- ie6下兼容问题
最小高度问题:overflow:hidden 在ie6.7下 li本身不浮动 内容浮动 li产生3像素间隙 解决:vertical-align:top; 二.当ie6下最小高度问题和li间隙问题共存时 ...
- js笔记---拖动元素
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- 训练集(train set) 验证集(validation set) 测试集(test set)
转自:http://www.cnblogs.com/xfzhang/archive/2013/05/24/3096412.html 在有监督(supervise)的机器学习中,数据集常被分成2~3个, ...
- Javascript中最常用的经典技巧
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键<table border oncontextmenu= ...
- Area(Pick定理POJ1256)
Area Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5429 Accepted: 2436 Description ...
- Pupu(快速幂取模)
Pupu Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submissi ...
- Python类的定义与使用
#! /usr/bin/python # Filename:objvar.py class Person: '''Represents a person.''' population = 0 def ...