Understanding `static` in JavaScript (with React) - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Sunday, September 30, 2018

Understanding `static` in JavaScript (with React)

TL;DR: Static properties are properties of a class, not of an instance of a class.In university, I was taught object-oriented programming in Java. Like most beginners, the first thing I learned was some version of this:https://medium.com/media/a99df875e63f2b2f3f3998f86d92672f/hrefGetting started, I was confused by all these keywords. public, static, void, String, etc… What are all these things!?Eventually, I learned the meaning behind most of these keywords and how to use them through passive exposure. public makes a class or method available to be used by other programs, void is a type of none, String is an array of chars. These all came naturally as I wrote more Java code. However, static remained a mystery to me for years to come. It simply didn't come up that often in assignments and projects (except for in that boilerplate main Java method shown above) so there was never a real need to learn its meaning.When I started learning React a couple years ago I started seeing static and began interacting with it more actively.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

web-development,javascript,react,tutorial,programming

No comments:

Post a Comment