DEV Community

Sham Gurav
Sham Gurav

Posted on


#9 Guess the output ???

function getUserId(...args) {
  console.log(typeof args);

Enter fullscreen mode Exit fullscreen mode

Options -
A) string
B) number
C) object
D) NaN

Reply with correct answer & WHY it is correct answer in comments.

Top comments (1)

westernal profile image
Ali Navidi

C - because args is an object and if we want type of 21 we can use console.log(typeof args[0]);