Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
they are strings
Source Link
Ionică Bizău
  • 114.3k
  • 95
  • 311
  • 490

Object.prototype.toString.call(myVar) will return:

  • [object Object]"[object Object]" if myVar is an object
  • [object Array]"[object Array]" if myVar is an array
  • etc.

For more information on this and why it is a good alternative to typeof, check out this article.

Object.prototype.toString.call(myVar) will return:

  • [object Object] if myVar is an object
  • [object Array] if myVar is an array
  • etc.

For more information on this and why it is a good alternative to typeof, check out this article.

Object.prototype.toString.call(myVar) will return:

  • "[object Object]" if myVar is an object
  • "[object Array]" if myVar is an array
  • etc.

For more information on this and why it is a good alternative to typeof, check out this article.

Source Link
Christophe
  • 28.3k
  • 29
  • 105
  • 145

Object.prototype.toString.call(myVar) will return:

  • [object Object] if myVar is an object
  • [object Array] if myVar is an array
  • etc.

For more information on this and why it is a good alternative to typeof, check out this article.