Differentiate between instance and local variables.

For instance, variables are declared inside a class, and the scope of variables in javascript is limited to only a specific object.

A local variable can be anywhere inside a method or a specific block of code. Also, the scope is limited to the code segment where the variable is declared.  


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *