成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

44個(gè)JavaScript{{BANNED}}題解析

aikin / 503人閱讀

摘要:第題知識(shí)點(diǎn)首先接受兩個(gè)參數(shù)一個(gè)回調(diào)函數(shù)一個(gè)回調(diào)函數(shù)的值其中回調(diào)函數(shù)接受三個(gè)參數(shù)而題目中只傳入了回調(diào)函數(shù)其次只接受兩個(gè)兩個(gè)參數(shù)基數(shù)可選。

第1題
["1", "2", "3"].map(parseInt)

知識(shí)點(diǎn):

Array/map

Number/parseInt

JavaScript parseInt

首先, map接受兩個(gè)參數(shù), 一個(gè)回調(diào)函數(shù) callback, 一個(gè)回調(diào)函數(shù)的this值

其中回調(diào)函數(shù)接受三個(gè)參數(shù) currentValue, index, arrary;

而題目中, map只傳入了回調(diào)函數(shù)–parseInt.

其次, parseInt 只接受兩個(gè)兩個(gè)參數(shù) string, radix(基數(shù)).

可選。表示要解析的數(shù)字的基數(shù)。該值介于 2 ~ 36 之間。

如果省略該參數(shù)或其值為 0,則數(shù)字將以 10 為基礎(chǔ)來(lái)解析。如果它以 “0x” 或 “0X” 開(kāi)頭,將以 16 為基數(shù)。

如果該參數(shù)小于 2 或者大于 36,則 parseInt() 將返回 NaN。

所以本題即問(wèn)

parseInt("1", 0);
parseInt("2", 1);
parseInt("3", 2);

首先后兩者參數(shù)不合法.

所以答案是?[1, NaN, NaN]

第2題
[typeof null, null instanceof Object]

兩個(gè)知識(shí)點(diǎn):

Operators/typeof

Operators/instanceof

Operators/instanceof(中)

typeof 返回一個(gè)表示類型的字符串.

instanceof 運(yùn)算符用來(lái)檢測(cè) constructor.prototype 是否存在于參數(shù) object 的原型鏈上.

這個(gè)題可以直接看鏈接… 因?yàn)?typeof null === "object"?自語(yǔ)言之初就是這樣….

typeof 的結(jié)果請(qǐng)看下表:

type         result
Undefined   "undefined"
Null        "object"
Boolean     "boolean"
Number      "number"
String      "string"
Symbol      "symbol"
Host object Implementation-dependent
Function    "function"
Object      "object"

所以答案?[object, false]

第3題
[ [3,2,1].reduce(Math.pow), [].reduce(Math.pow) ]

知識(shí)點(diǎn):

Array/Reduce

arr.reduce(callback[, initialValue])

reduce接受兩個(gè)參數(shù), 一個(gè)回調(diào), 一個(gè)初始值.

回調(diào)函數(shù)接受四個(gè)參數(shù)?previousValue, currentValue, currentIndex, array

需要注意的是?If the array is empty and no initialValue was provided, TypeError would be thrown.

所以第二個(gè)表達(dá)式會(huì)報(bào)異常. 第一個(gè)表達(dá)式等價(jià)于?Math.pow(3, 2) => 9; Math.pow(9, 1) =>9

答案?an error

第4題
var val = "smtg";
console.log("Value is " + (val === "smtg") ? "Something" : "Nothing");

兩個(gè)知識(shí)點(diǎn):

Operators/Operator_Precedence

Operators/Conditional_Operator

簡(jiǎn)而言之?+?的優(yōu)先級(jí) 大于??

所以原題等價(jià)于?"Value is true" ? "Somthing" : "Nonthing"?而不是?"Value is" + (true ? "Something" : "Nonthing")

答案?"Something"

第5題
var name = "World!";
(function () {
    if (typeof name === "undefined") {
        var name = "Jack";
        console.log("Goodbye " + name);
    } else {
        console.log("Hello " + name);
    }
})();

這個(gè)相對(duì)簡(jiǎn)單, 一個(gè)知識(shí)點(diǎn):

Hoisting

在 JavaScript中, functions 和 variables 會(huì)被提升。變量提升是JavaScript將聲明移至作用域 scope (全局域或者當(dāng)前函數(shù)作用域) 頂部的行為。

這個(gè)題目相當(dāng)于

var name = "World!";
(function () {
    var name;
    if (typeof name === "undefined") {
        name = "Jack";
        console.log("Goodbye " + name);
    } else {
        console.log("Hello " + name);
    }
})();

所以答案是?"Goodbye Jack"

第6題
var END = Math.pow(2, 53);
var START = END - 100;
var count = 0;
for (var i = START; i <= END; i++) {
    count++;
}
console.log(count);

一個(gè)知識(shí)點(diǎn):

Infinity

在 JS 里, Math.pow(2, 53) == 9007199254740992 是可以表示的最大值. 最大值加一還是最大值. 所以循環(huán)不會(huì)停.

補(bǔ)充:?@jelly7723

js中可以表示的最大整數(shù)不是2的53次方,而是1.7976931348623157e+308。
2的53次方不是js能表示的最大整數(shù)而應(yīng)該是能正確計(jì)算且不失精度的最大整數(shù),可以參見(jiàn)js權(quán)威指南。
9007199254740992 +1還是 9007199254740992 ,這就是因?yàn)榫葐?wèn)題,如果 9007199254740992 +11或者 9007199254740992 +111的話,值是會(huì)發(fā)生改變的,只是這時(shí)候計(jì)算的結(jié)果不是正確的值,就是因?yàn)榫葋G失的問(wèn)題。

第7題
var ary = [0,1,2];
ary[10] = 10;
ary.filter(function(x) { return x === undefined;});

答案是?[]

看一篇文章理解稀疏數(shù)組

譯 JavaScript中的稀疏數(shù)組與密集數(shù)組

Array/filter

我們來(lái)看一下 Array.prototype.filter 的 polyfill:

if (!Array.prototype.filter) {
  Array.prototype.filter = function(fun/*, thisArg*/) {
    "use strict";

    if (this === void 0 || this === null) {
      throw new TypeError();
    }

    var t = Object(this);
    var len = t.length >>> 0;
    if (typeof fun !== "function") {
      throw new TypeError();
    }

    var res = [];
    var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
    for (var i = 0; i < len; i++) {
      if (i in t) { // 注意這里!!!
        var val = t[i];
        if (fun.call(thisArg, val, i, t)) {
          res.push(val);
        }
      }
    }

    return res;
  };
}

我們看到在迭代這個(gè)數(shù)組的時(shí)候, 首先檢查了這個(gè)索引值是不是數(shù)組的一個(gè)屬性, 那么我們測(cè)試一下.

0 in ary; => true
3 in ary; => false
10 in ary; => true

也就是說(shuō) 從 3 – 9 都是沒(méi)有初始化的’坑’!, 這些索引并不存在與數(shù)組中. 在 array 的函數(shù)調(diào)用的時(shí)候是會(huì)跳過(guò)這些’坑’的.

第8題
var two   = 0.2
var one   = 0.1
var eight = 0.8
var six   = 0.6
[two - one == one, eight - six == two]

JavaScript的設(shè)計(jì)缺陷?浮點(diǎn)運(yùn)算:0.1 + 0.2 != 0.3

IEEE 754標(biāo)準(zhǔn)中的浮點(diǎn)數(shù)并不能精確地表達(dá)小數(shù)

那什么時(shí)候精準(zhǔn), 什么時(shí)候不經(jīng)準(zhǔn)呢? 筆者也不知道…

答案?[true, false]

第9題
function showCase(value) {
    switch(value) {
    case "A":
        console.log("Case A");
        break;
    case "B":
        console.log("Case B");
        break;
    case undefined:
        console.log("undefined");
        break;
    default:
        console.log("Do not know!");
    }
}
showCase(new String("A"));

兩個(gè)知識(shí)點(diǎn):

Statements/switch

String

switch 是嚴(yán)格比較, String 實(shí)例和 字符串不一樣.

var s_prim = "foo";
var s_obj = new String(s_prim);

console.log(typeof s_prim); // "string"
console.log(typeof s_obj);  // "object"
console.log(s_prim === s_obj); // false

答案是?"Do not know!"

第10題
function showCase2(value) {
    switch(value) {
    case "A":
        console.log("Case A");
        break;
    case "B":
        console.log("Case B");
        break;
    case undefined:
        console.log("undefined");
        break;
    default:
        console.log("Do not know!");
    }
}
showCase2(String("A"));

解釋:

String(x) does not create an object but does return a string, i.e. typeof String(1) === "string"

還是剛才的知識(shí)點(diǎn), 只不過(guò) String 不僅是個(gè)構(gòu)造函數(shù) 直接調(diào)用返回一個(gè)字符串哦.

答案?"Case A"

第11題
function isOdd(num) {
    return num % 2 == 1;
}
function isEven(num) {
    return num % 2 == 0;
}
function isSane(num) {
    return isEven(num) || isOdd(num);
}
var values = [7, 4, "13", -9, Infinity];
values.map(isSane);

一個(gè)知識(shí)點(diǎn)

Arithmetic_Operators#Remainder

此題等價(jià)于

7 % 2 => 1
4 % 2 => 0
"13" % 2 => 1
-9 % % 2 => -1
Infinity % 2 => NaN

需要注意的是 余數(shù)的正負(fù)號(hào)隨第一個(gè)操作數(shù).

答案?[true, true, true, false, false]

第12題
parseInt(3, 8)
parseInt(3, 2)
parseInt(3, 0)

第一個(gè)題講過(guò)了, 答案?3, NaN, 3

第13題
Array.isArray( Array.prototype )

一個(gè)知識(shí)點(diǎn):

Array/prototype

一個(gè)鮮為人知的實(shí)事:?Array.prototype => [];

答案:?true

第14題
var a = [0];
if ([0]) {
  console.log(a == true);
} else {
  console.log("wut");
}

JavaScript-Equality-Table

答案:?false

第15題
[]==[]

==?是萬(wàn)惡之源, 看上圖

答案是?false

第16題
"5" + 3
"5" - 3

兩個(gè)知識(shí)點(diǎn):

Arithmetic_Operators#Addition

Arithmetic_Operators#Subtraction

+?用來(lái)表示兩個(gè)數(shù)的和或者字符串拼接,?-表示兩數(shù)之差.

請(qǐng)看例子, 體會(huì)區(qū)別:

> "5" + 3
"53"
> 5 + "3"
"53"
> 5 - "3"
2
> "5" - 3
2
> "5" - "3"
2

也就是說(shuō)?-?會(huì)盡可能的將兩個(gè)操作數(shù)變成數(shù)字, 而?+?如果兩邊不都是數(shù)字, 那么就是字符串拼接.

答案是?"53", 2

第17題
1 + - + + + - + 1

這里應(yīng)該是(倒著看)

1 + (a)  => 2
a = - (b) => 1
b = + (c) => -1
c = + (d) => -1
d = + (e) => -1
e = + (f) => -1
f = - (g) => -1
g = + 1   => 1

所以答案?2

第18題
var ary = Array(3);
ary[0]=2
ary.map(function(elem) { return "1"; });

稀疏數(shù)組. 同第7題.

題目中的數(shù)組其實(shí)是一個(gè)長(zhǎng)度為3, 但是沒(méi)有內(nèi)容的數(shù)組, array 上的操作會(huì)跳過(guò)這些未初始化的’坑’.

所以答案是?["1", undefined × 2]

這里貼上 Array.prototype.map 的 polyfill.

Array.prototype.map = function(callback, thisArg) {

        var T, A, k;

        if (this == null) {
            throw new TypeError(" this is null or not defined");
        }

        var O = Object(this);
        var len = O.length >>> 0;
        if (typeof callback !== "function") {
            throw new TypeError(callback + " is not a function");
        }
        if (arguments.length > 1) {
            T = thisArg;
        }
        A = new Array(len);
        k = 0;
        while (k < len) {
            var kValue, mappedValue;
            if (k in O) {
                kValue = O[k];
                mappedValue = callback.call(T, kValue, k, O);
                A[k] = mappedValue;
            }
            k++;
        }
        return A;
    };
第19題
function sidEffecting(ary) {
  ary[0] = ary[2];
}
function bar(a,b,c) {
  c = 10
  sidEffecting(arguments);
  return a + b + c;
}
bar(1,1,1)

這是一個(gè)大坑, 尤其是涉及到 ES6語(yǔ)法的時(shí)候

知識(shí)點(diǎn):

Functions/arguments

首先?The arguments object is an Array-like object corresponding to the arguments passed to a function.

也就是說(shuō)?arguments?是一個(gè)?object, c 就是 arguments[2], 所以對(duì)于 c 的修改就是對(duì) arguments[2] 的修改.

所以答案是?21.

然而!!!!!!

當(dāng)函數(shù)參數(shù)涉及到?any rest parameters, any default parameters or any destructured parameters?的時(shí)候, 這個(gè) arguments 就不在是一個(gè)?mapped arguments object?了…..

請(qǐng)看:

function sidEffecting(ary) {
  ary[0] = ary[2];
}
function bar(a,b,c=3) {
  c = 10
  sidEffecting(arguments);
  return a + b + c;
}
bar(1,1,1)

答案是?12?!!!!

請(qǐng)讀者細(xì)細(xì)體會(huì)!!

第20題
var a = 111111111111111110000,
    b = 1111;
a + b;

答案還是?111111111111111110000. 解釋是?Lack of precision for numbers in JavaScript affects both small and big numbers.?但是筆者不是很明白……………. 請(qǐng)讀者賜教!

第21題
var x = [].reverse;
x();

這個(gè)題有意思!

知識(shí)點(diǎn):

Array/reverse

The reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array.

也就是說(shuō) 最后會(huì)返回這個(gè)調(diào)用者(this), 可是 x 執(zhí)行的時(shí)候是上下文是全局. 那么最后返回的是?window.

答案是?window

第22題
Number.MIN_VALUE > 0

true

第23題
[1 < 2 < 3, 3 < 2 < 1]

這個(gè)題也還可以.

這個(gè)題會(huì)讓人誤以為是?2 > 1 && 2 < 3?其實(shí)不是的.

這個(gè)題等價(jià)于

 1 < 2 => true;
 true < 3 =>  1 < 3 => true;
 3 < 2 => false;
 false < 1 => 0 < 1 => true;

答案是?[true, true]

第24題
// the most classic wtf
2 == [[[2]]]

這個(gè)題我是猜的. 我猜的?true, 至于為什么…..

both objects get converted to strings and in both cases the resulting string is "2"?我不能信服…

第25題
3.toString()
3..toString()
3...toString()

這個(gè)題也挺逗, 我做對(duì)了答案是?error, "3", error

你如果換一個(gè)寫法就更費(fèi)解了

var a = 3;
a.toString()

這個(gè)答案就是?"3";

為啥呢?

因?yàn)樵?js 中?1.1,?1.,?.1?都是合法的數(shù)字. 那么在解析?3.toString?的時(shí)候這個(gè)?.?到底是屬于這個(gè)數(shù)字還是函數(shù)調(diào)用呢? 只能是數(shù)字, 因?yàn)?b>3.合法啊!

第26題
(function(){
  var x = y = 1;
})();
console.log(y);
console.log(x);

答案是?1, error

y 被賦值到全局. x 是局部變量. 所以打印 x 的時(shí)候會(huì)報(bào)?ReferenceError

第27題
var a = /123/,
    b = /123/;
a == b
a === b

即使正則的字面量一致, 他們也不相等.

答案?false, false

第28題
var a = [1, 2, 3],
    b = [1, 2, 3],
    c = [1, 2, 4]
a ==  b
a === b
a >   c
a <   c

字面量相等的數(shù)組也不相等.

數(shù)組在比較大小的時(shí)候按照字典序比較

答案?false, false, false, true

第29題
var a = {}, b = Object.prototype;
[a.prototype === b, Object.getPrototypeOf(a) === b]

知識(shí)點(diǎn):

Object/getPrototypeOf

只有 Function 擁有一個(gè) prototype 的屬性. 所以?a.prototype?為?undefined.

而?Object.getPrototypeOf(obj)?返回一個(gè)具體對(duì)象的原型(該對(duì)象的內(nèi)部[[prototype]]值)

答案?false, true

第30題
function f() {}
var a = f.prototype, b = Object.getPrototypeOf(f);
a === b

f.prototype is the object that will become the parent of any objects created with new f while Object.getPrototypeOf returns the parent in the inheritance hierarchy.

f.prototype 是使用使用 new 創(chuàng)建的 f 實(shí)例的原型. 而 Object.getPrototypeOf 是 f 函數(shù)的原型.

請(qǐng)看:

a === Object.getPrototypeOf(new f()) // true
b === Function.prototype // true

答案?false

第31題
function foo() { }
var oldName = foo.name;
foo.name = "bar";
[oldName, foo.name]

答案?["foo", "foo"]

知識(shí)點(diǎn):

Function/name

因?yàn)楹瘮?shù)的名字不可變.

第32題
"1 2 3".replace(/d/g, parseInt)

知識(shí)點(diǎn):

String/replace#Specifying_a_function_as_a_parameter

str.replace(regexp|substr, newSubStr|function)

如果replace函數(shù)傳入的第二個(gè)參數(shù)是函數(shù), 那么這個(gè)函數(shù)將接受如下參數(shù)

match 首先是匹配的字符串

p1, p2 …. 然后是正則的分組

offset match 匹配的index

string 整個(gè)字符串

由于題目中的正則沒(méi)有分組, 所以等價(jià)于問(wèn)

parseInt("1", 0)
parseInt("2", 2)
parseInt("3", 4)

答案:?1, NaN, 3

第33題
function f() {}
var parent = Object.getPrototypeOf(f);
f.name // ?
parent.name // ?
typeof eval(f.name) // ?
typeof eval(parent.name) //  ?

先說(shuō)以下答案?"f", "Empty", "function", error?這個(gè)答案并不重要…..

這里第一小問(wèn)和第三小問(wèn)很簡(jiǎn)單不解釋了.

第二小問(wèn)筆者在自己的瀏覽器測(cè)試的時(shí)候是?"", 第四問(wèn)是?"undefined"

所以應(yīng)該是平臺(tái)相關(guān)的. 這里明白?parent === Function.prototype?就好了.

第34題
var lowerCaseOnly =  /^[a-z]+$/;
[lowerCaseOnly.test(null), lowerCaseOnly.test()]

知識(shí)點(diǎn):

RegExp/test

這里 test 函數(shù)會(huì)將參數(shù)轉(zhuǎn)為字符串.?"nul",?"undefined"?自然都是全小寫了

答案:?true, true

第35題
[,,,].join(", ")

[,,,] => [undefined × 3]

因?yàn)閖avascript 在定義數(shù)組的時(shí)候允許最后一個(gè)元素后跟一個(gè),, 所以這是個(gè)長(zhǎng)度為三的稀疏數(shù)組(這是長(zhǎng)度為三, 并沒(méi)有 0, 1, 2三個(gè)屬性哦)

答案:?", , "

第36題
var a = {class: "Animal", name: "Fido"};
a.class

這個(gè)題比較流氓.. 因?yàn)槭菫g覽器相關(guān),?class是個(gè)保留字(現(xiàn)在是個(gè)關(guān)鍵字了)

所以答案不重要, 重要的是自己在取屬性名稱的時(shí)候盡量避免保留字. 如果使用的話請(qǐng)加引號(hào)?a["class"]

第37題
var a = new Date("epoch")

知識(shí)點(diǎn):

Date

Date/parse

簡(jiǎn)單來(lái)說(shuō), 如果調(diào)用 Date 的構(gòu)造函數(shù)傳入一個(gè)字符串的話需要符合規(guī)范, 即滿足 Date.parse 的條件.

另外需要注意的是 如果格式錯(cuò)誤 構(gòu)造函數(shù)返回的仍是一個(gè)Date 的實(shí)例?Invalid Date.

答案?Invalid Date

第38題
var a = Function.length,
    b = new Function().length
a === b

我們知道一個(gè)function(Function 的實(shí)例)的?length?屬性就是函數(shù)簽名的參數(shù)個(gè)數(shù), 所以 b.length == 0.

另外 Function.length 定義為1……

所以不相等…….答案?false

第39題
var a = Date(0);
var b = new Date(0);
var c = new Date();
[a === b, b === c, a === c]

還是關(guān)于Date 的題, 需要注意的是

如果不傳參數(shù)等價(jià)于當(dāng)前時(shí)間.

如果是函數(shù)調(diào)用 返回一個(gè)字符串.

答案?false, false, false

第40題
var min = Math.min(), max = Math.max()
min < max

知識(shí)點(diǎn):

Math/min

Math/max

有趣的是, Math.min 不傳參數(shù)返回?Infinity, Math.max 不傳參數(shù)返回?-Infinity

答案:?false

第41題
function captureOne(re, str) {
  var match = re.exec(str);
  return match && match[1];
}
var numRe  = /num=(d+)/ig,
    wordRe = /word=(w+)/i,
    a1 = captureOne(numRe,  "num=1"),
    a2 = captureOne(wordRe, "word=1"),
    a3 = captureOne(numRe,  "NUM=2"),
    a4 = captureOne(wordRe,  "WORD=2");
[a1 === a2, a3 === a4]

知識(shí)點(diǎn):

RegExp/exec

通俗的講

因?yàn)榈谝粋€(gè)正則有一個(gè) g 選項(xiàng) 它會(huì)‘記憶’他所匹配的內(nèi)容, 等匹配后他會(huì)從上次匹配的索引繼續(xù), 而第二個(gè)正則不會(huì)

舉個(gè)例子

var myRe = /ab*/g;
var str = "abbcdefabh";
var myArray;
while ((myArray = myRe.exec(str)) !== null) {
  var msg = "Found " + myArray[0] + ". ";
  msg += "Next match starts at " + myRe.lastIndex;
  console.log(msg);
}
// Found abb. Next match starts at 3
// Found ab. Next match starts at 9

所以 a1 = ’1′; a2 = ’1′; a3 = null; a4 = ’2′

答案?[true, false]

第42題
var a = new Date("2014-03-19"),
    b = new Date(2014, 03, 19);
[a.getDay() === b.getDay(), a.getMonth() === b.getMonth()]

這個(gè)….

JavaScript inherits 40 years old design from C: days are 1-indexed in C’s struct tm, but months are 0 indexed. In addition to that, getDay returns the 0-indexed day of the week, to get the 1-indexed day of the month you have to use getDate, which doesn’t return a Date object.

a.getDay()
3
b.getDay()
6
a.getMonth()
2
b.getMonth()
3

都是套路!

答案?[false, false]

第43題
if ("http://giftwrapped.com/picture.jpg".match(".gif")) {
  "a gif file"
} else {
  "not a gif file"
}

知識(shí)點(diǎn):

String/match

String.prototype.match 接受一個(gè)正則, 如果不是, 按照?new RegExp(obj)?轉(zhuǎn)化. 所以?.?并不會(huì)轉(zhuǎn)義
那么?/gif?就匹配了 /.gif/

答案:?"a gif file"

第44題
function foo(a) {
    var a;
    return a;
}
function bar(a) {
    var a = "bye";
    return a;
}
[foo("hello"), bar("hello")]

在兩個(gè)函數(shù)里, a作為參數(shù)其實(shí)已經(jīng)聲明了, 所以?var a; var a = "bye"?其實(shí)就是?a; a ="bye"

所以答案?"hello", "bye"

轉(zhuǎn)載自:http://www.codeceo.com
英文原文:javascript-puzzlers

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/79991.html

相關(guān)文章

  • 44個(gè) Javascript 變態(tài)解析 (上)

    摘要:變量提升是將聲明移至作用域全局域或者當(dāng)前函數(shù)作用域頂部的行為。 原文來(lái)自我的 github 原題來(lái)自: javascript-puzzlers 44個(gè) Javascript 變態(tài)題解析 (下) 讀者可以先去做一下感受感受. 當(dāng)初筆者的成績(jī)是 21/44... 當(dāng)初筆者做這套題的時(shí)候不僅懷疑智商, 連人生都開(kāi)始懷疑了.... 不過(guò), 對(duì)于基礎(chǔ)知識(shí)的理解是深入編程的前提. 讓我們一起來(lái)看看...

    k00baa 評(píng)論0 收藏0
  • 44個(gè) Javascript 變態(tài)解析 (下)

    摘要:原文發(fā)布于我的承接上篇個(gè)變態(tài)題解析上第題這個(gè)題也還可以這個(gè)題會(huì)讓人誤以為是其實(shí)不是的這個(gè)題等價(jià)于答案是第題這個(gè)題我是猜的我猜的至于為什么我不能信服第題這個(gè)題也挺逗我做對(duì)了答案是你如果換一個(gè)寫法就更費(fèi)解了這個(gè)答案就是為啥呢因?yàn)樵谥卸际呛戏ǖ臄?shù) 原文發(fā)布于我的 github 承接上篇 44個(gè) Javascript 變態(tài)題解析 (上) 第23題 [1 < 2 < 3, 3 < 2 < 1] ...

    HmyBmny 評(píng)論0 收藏0
  • 實(shí)用性前端知識(shí) - 收藏集 - 掘金

    摘要:與面向?qū)ο缶幊塘蠓较蛑阃黄魄岸松钠脚_(tái)期前端掘金無(wú)論我們從事何種職業(yè),在職業(yè)生涯的某個(gè)階段,都或多或少會(huì)遇到所謂的平臺(tái)期。目前為止,已經(jīng)有個(gè)用戶通過(guò)認(rèn)證登觀點(diǎn)年前端初學(xué)者的生存指南前端掘金逝者如斯夫,不舍晝夜。 你可能聽(tīng)說(shuō)過(guò)函數(shù)式編程(Functional programming),甚至已經(jīng)使用了一段時(shí)間。 但是,你能說(shuō)清楚,它到底是什么嗎? 網(wǎng)上搜索一下,你會(huì)輕松找到好多答案...

    Honwhy 評(píng)論0 收藏0
  • 轉(zhuǎn)載:《44個(gè)Javascript變態(tài)

    摘要:第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題第題屬性是中可表示的最小的數(shù)接近,但不是負(fù)數(shù)。 第1題 [1,2,3].map(parseInt); 第2題 [typeof null,null instanceOf Object] 第3題 [[3,2,1].reduce(Math.pow),[].reduce(Math.pow)] 第4題 var v...

    BDEEFE 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

aikin

|高級(jí)講師

TA的文章

閱讀更多
最新活動(dòng)
閱讀需要支付1元查看
<