js遇到这样基础题,看你能不能作对呢
var a = (function() {
return typeof arguments;
})();
alert(a); //Object
var b = (function(x) {
delete x;
return x;
})();
alert(b); //undefined
//**********************
var f = function g() {
return 23;
typeof g();
}
alert(f); //function。。。。
//********************************
var y=1, x = y = typeof x;
x;
alert(x);//undefined
alert(x = y = typeof x);//string
//********************************
var g = (function f(f) {
return typeof f();
})(function() {
return 1;
});
alert(g); //number
//**************************************
var foo = {
bar: function() {
return this.baz;},
baz: 1
};
var g = (function() {
return typeof arguments[0]();
})(foo.bar);
alert(g); //undefined
//****************
var foo = {
bar: function(){ return this.baz; },
baz: 1
}
alert(typeof (f = foo.bar)());
//*********************************************
var f = (function f(){ return "1"; }, function g(){ return 2; })();
alert(typeof f); //number
var x = 1;
if (function f(){}) {
x += typeof f;
alert(x);
}
alert(x); //1number
//alert(function g() {});
//****************************************
function f() {
return f;
}
alert(new f() instanceof f); //false
//*****************************************
var g = (function f(){
function f(){ return 1; }
return f();
function f(){ return 2; }
})();
alert(g); //
//********************************************
var k = (function(foo){
return typeof foo.bar;
})({ foo: { bar: 1 } });
alert(k); //undefined
//******************************************
var x = [typeof x, typeof y][1];
alert(typeof typeof typeof x); //string
//******************************************
with (function(x, undefined){})
alert(length); //
*/
var j = (function(x){
delete x;
return x;
})(1);
alert(j); //
转自:http://perfectionkills.com/javascript-quiz
js遇到这样基础题,看你能不能作对呢的更多相关文章
- 小试牛刀2:JavaScript基础题
JavaScript基础题 1.网页中有个字符串“我有一个梦想”,使用JavaScript获取该字符串的长度,同时输出字符串最后两个字. 答案: <!DOCTYPE html PUBLIC &q ...
- nyist oj 79 拦截导弹 (动态规划基础题)
拦截导弹 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描写叙述 某国为了防御敌国的导弹突击.发展中一种导弹拦截系统.可是这样的导弹拦截系统有一个缺陷:尽管它的第一发炮弹可以 ...
- Angular JS从入门基础 mvc三层架构 常用指令
Angular JS从入门基础 mvc模型 常用指令 ★ 最近一直在复习AngularJS,它是一款优秀的前端JS框架,已经被用于Google的多款产品当中.AngularJS有着诸多特性,最为核心 ...
- 【原创】这道Java基础题真的有坑!我也没想到还有续集。
前情回顾 自从我上次发了<这道Java基础题真的有坑!我求求你,认真思考后再回答.>这篇文章后.我通过这样的一个行文结构: 解析了小马哥出的这道题,让大家明白了这题的坑在哪里,这题背后隐藏 ...
- hdu 2089 不要62 (数位dp基础题)
不要62 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- JS函数的基础部分
JS函数的基础部分 JS函数的部分: 先看下一段的代码: window.onload = function(){ function test(){ alert("123"); ...
- (转)python资料汇总(建议收藏)零基础必看
摘要:没料到在悟空问答的回答大受欢迎,为方便朋友,重新整理汇总,内容包括长期必备.入门教程.练手项目.学习视频. 一.长期必备. 1. StackOverflow,是疑难解答.bug排除必备网站,任何 ...
- java面试| 精选基础题(2)
关注微信公众号"java从心",置顶公众号 每天进步一点点,距离大腿又近一步! 阅读本文大概需要6分钟 继续挖掘一些有趣的基础面试题,有错望指出来哈,请赐教~ 1.包装类的装箱与拆 ...
- 一些iOS面试基础题总结
一些iOS面试基础题总结 目录 多线程 AutoLayout objc_msgSend Runtime 消息转发 Category NSObject 与 objc_class Runloop Auto ...
随机推荐
- USACO Section 4.2: The Perfect Stall
这题关键就在将题转换成最大流模板题.首先有一个原始点,N个cow个点, M个barn点和一个终点,原始点到cow点和barn点到终点的流都为1,而cow对应的barn就是cow点到对应barn点的流, ...
- USACO Section 3.2: Feed Ratios
直接暴力搜 /* ID: yingzho1 LANG: C++ TASK: ratios */ #include <iostream> #include <fstream> # ...
- 蒙特罗卡π算法(C++语言描述)
圆的面积计算公式为:S=π*r*r 将圆放到一个直角坐标系中,如图黄色部分的面积是S/4=(π*r*r)/4;如果我们将取一个单位圆,则S/4=π/4. 因为是单位圆,半径为1,所以图中红色正方形的面 ...
- NandFlash详述【转】
NandFlash详述 转自:http://wenku.baidu.com/view/04d9330bb52acfc789ebc92f.html?re=view 1. 硬件特性: [Flash的硬件实 ...
- CrazePony飞行器--相关资料网址
Crazepony官网:http://crazepony.github.com/ Crazepony百科:http://crazepony.github.com/wiki.html Crazepony ...
- Maven+Spring+Hibernate+Shiro+Mysql简单的demo框架(二)
然后是项目下的文件:完整的项目请看 上一篇 Maven+Spring+Hibernate+Shiro+Mysql简单的demo框架(一) 项目下的springmvc-servlet.xml配置文件: ...
- [原]poj-3009-Curling 2.0-dfs
题目太长就不贴了,题意: 上下左右四联通块,2表示起点,3表示终点,1为block,0为空地,每动一次冰壶,冰壶就会向推动的方向一直移动,直到碰到block或出界,如果碰到block就在block前停 ...
- ERP
企业资源计划即 ERP (Enterprise Resource Planning),由美国 Gartner Group 公司于1990年提出.企业资源计划是 MRP II(企业制造资源计划)下一代的 ...
- [HDOJ1160]FatMouse's Speed(DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1160 FatMouse believes that the fatter a mouse is, th ...
- Asp.Net验证码3
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System. ...