menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

JavaScript...
source image

Dev

1M

read

265

img
dot

Image Credit: Dev

JavaScript Interview Trick: typeof vs instanceof

  • The 'typeof' operator in JavaScript is used to return a string indicating the type of the operand.
  • The 'instanceof' operator in JavaScript is used to check the current object and returns true if an object is an instance of a particular class or constructor.
  • The 'typeof' operator is used when you want to know the type of a primitive value.
  • The 'instanceof' operator is used when you want to know if an object is an instance of a certain class.

Read Full Article

like

15 Likes

For uninterrupted reading, download the app