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个技能点的最大值减最小值最小,输出符合要求的策略. 解法:尺取法.将课 ...
随机推荐
- java笔试题整理
exit()是system类的方法,如system.exit(); 如果某个方法是静态的,它的行为就不具有多态性. 类后面没有括号,方法必须要有返回值.如果没有返回值,要写void 构造函数不具有多态 ...
- javascript 金额格式化
金额格式化 example: <!DOCTYPE html> <html> <head> <script src="http://code.jque ...
- PHP自定义函数格式化json数据怎么调用?
<?php/*** Formats a JSON string for pretty printing** @param string $json The JSON to make pretty ...
- Volley的基本用法
1. Volley简介 我们平时在开发Android应用的时候不可避免地都需要用到网络技术,而多数情况下应用程序都会使用HTTP协议来发送和接收网络数据.Android系统中主要提供了两种方式来进行H ...
- mongo 日记
分组代码片段 命令行代码: aggregate({$group:{_id:{A:'$A',B:'$B',C:'$C'}}}) 拿出唯一号有重复的数据: > db.aaaa.aggregate([ ...
- PostgreSQL连接python,postgresql在python 连接,创建表,创建表内容,插入操作,选择操作,更新操作,删除操作。
安装 PostgreSQL可以用Python psycopg2模块集成. sycopg2是Python编程语言的PostgreSQL数据库的适配器. 其程序代码少,速度快,稳定.不需要单独安装这个模块 ...
- python实现删除文件与目录的方法
os.remove(path) 删除文件 path. 如果path是一个目录, 抛出 OSError错误.如果要删除目录,请使用rmdir().os.rmdir()只能删除空目录 remove() 同 ...
- [团队项目3.0]Scrum团队成立
Scrum团队成立 5.Scrum团队成立 5.1 团队名称,团队目标.团队口号.团队照: 5.2 角色分配 产品负责人: 决定开发内容和优先级排序,最大化产品以及开发团队工作的价值. Scrum M ...
- c# Beginlnvoke 委托
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- SQL-字符串合并
create table tb(id int, value varchar(10)) insert into tb values(1, 'aa') insert into tb values(1, ...