2013-09-01 47 views

Trả lời

7

  • typeof là một nhà điều hành, không phải là một chức năng, vì vậy typeof(expr)typeof expr, với exprevaluated first
  • a,b returns b

Vì vậy

typeof (a, b) lợi nhuận typeof b

và trong trường hợp của bạn

  • typeof (Array, null)typeof nullwhich is "object"
  • typeof(null, Array)typeof Array, và Array là một hàm.
+0

Tại sao '(a, b)' trả về b? – 2619

+3

@ 2619 [Toán tử dấu phẩy] (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator) – Andreas

Các vấn đề liên quan