面试题023-43道js题撸题篇18

133 阅读1分钟

前两年很火的43道js面试题,一天一道,啃一遍

第十八题

function getAge(...args) {
  console.log(typeof args);
}

getAge(21);

扩展运算符(... args)返回一个带参数的数组。 数组是一个对象,因此typeof args返回object