js遇到这样基础题

连接url:http://perfectionkills.com/javascript-quiz
/* 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); //2
  //********************************************

  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); //2
      */

      var j = (function(x){
    delete x;
    return x;
  })(1);
  alert(j); //1
时间: 2024-08-11 23:00:41

js遇到这样基础题的相关文章

1、基础题

基础题: 1.表单中 get与post提交方法的区别? 答:get是发送请求HTTP协议通过url参数传递进行接收,而post是实体数据,可以通过表单提交大量信息. 2.session与cookie的区别? 答:session:储存用户访问的全局唯一变量,存储在服务器上的php指定的目录中的(session_dir)的位置进行的存放 cookie:用来存储连续訪問一个頁面时所使用,是存储在客户端,对于Cookie来说是存储在用户WIN的Temp目录中的. 两者都可通过时间来设置时间长短 3.数据

Angular JS从入门基础 mvc三层架构 常用指令

Angular JS从入门基础  mvc模型 常用指令 ★ 最近一直在复习AngularJS,它是一款优秀的前端JS框架,已经被用于Google的多款产品当中.AngularJS有着诸多特性,最为核心的是:MVC.模块化.自动化双向数据绑定.语义化标签.依赖注入等等. 1.常用指令 AngularJS 通过指令扩展了HTML,且通过表达式绑定数据到 HTML.下面我们看一下AngularJS中的常用指令. (1).基本概念 指令:AngularJS中,通过扩展HTML的属性提供功能.所以,ng-

【HDU1232】畅通工程(并查集基础题)

裸敲并查集,很水一次AC 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <cctype> 6 #include <cmath> 7 #include <algorithm> 8 #include <numeric> 9 #include <string> 1

linux 基础题整理

基础题: 1.查看系统内核版本号及系统名称 2.查看smb服务所用的端口号 3.禁ping 4.查出22端口现在运行什么程序 5.登录提示符前的输出信息"you are welcome!!!" 6.成功登录后自动输出信息"距离全国比赛还剩1天!!!" 7.确认安全终端为tty1 8.取消普通用户的控制台访问的三个权限:reboot.halt.shutdown 9.只允许组ID为10的成员通过su命令改变为root用户 10.禁止Control-Alt-Delete键

一些DP基础题(1)

HDU 1024  Max Sum Plus Plus Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Given a consecutive num

【坑】这些天刷基础题犯的诡异错误大集合

这些天刷基础题犯的诡(sha)异(bi)错误大集合 by pkl ———其中可能会有部分资料引用,引用会表明链接,如果没有标明敬请指出QAQ抱歉QAQ---------------------------------- 首先安利一发帖子:OI中有哪些常数优化的小技巧 ps:注意是基础题.所以嘛错误nc需要原谅..毕竟我也是蒟蒻QAQAQ大蒟蒻QAQ · 循环里的临时变量出了循环便无效· 递归的临时变量不要定成全局变量· 赋值的对象不要一不小心手抖写反了…比如b = a写成a = b[估计也只有我

nyist oj 36 最长公共子序列 (动态规划基础题)

最长公共子序列 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 咱们就不拐弯抹角了,如题,需要你做的就是写一个程序,得出最长公共子序列. tip:最长公共子序列也称作最长公共子串(不要求连续),英文缩写为LCS(Longest Common Subsequence).其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列. 输入 第一行给出一个整数N(0<N<100)表示待测数据组数 接

【HDU1102】Constructing Roads(MST基础题)

最小生成树水题.prim一次AC 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <cctype> 6 #include <cmath> 7 #include <algorithm> 8 #include <numeric> 9 10 #define typec int

类和对象基础题

一.           类和对象基础题 1.编写一个Java应用程序,该程序中有3个类:Ladder.Circle和主类A.具体要求如下:Ladder类具有类型为double的上底.下底.高.面积属性,具有返回面积的功能,包括一个构造方法对上底.下底.高进行初始化.Circle类具有类型为double的半径.周长和面积属性,具有返回周长.面积的功能,包括一个构造方法对半径进行初始化.主类A用来测试类Ladder和类Circle的功能. 2.按要求编写Java应用程序: (1)编写西游记人物类(