首页 > 解决方案 > typeof 2D 数组将变为 String。为什么?

问题描述

<script>

  var x = [typeof x, typeof y][1];
  console.log(typeof x);

</script>

标签: javascripthtmlarraysstringfunction

解决方案


[typeof x, typeof y]评估为["undefined", "undefined"][typeof x, typeof y][1]评估为"undefined"


推荐阅读