Andre DiCioccio

Law, Technology and Finance

JavaScript ES7 Static Class Properties

In ES6 you can declare static functions which apply to ES6 classes but ES7 adds the ability to declare static properties also.

A static property can be useful in a large number of situations, such as the following (contrived example):

class Cat {
 static legCount = 4
}
console.log(Cat.legCount) // 4

 

Related articles

ECMA Script Block Scoped Declarations

ECMA Script 6 has introduced the ability to use const and let instead of var to declare local variables. The main benefit of this is that const and let are scoped to the block level (meaning their scope is confined to a blocked deliminated with curly brackets). A further benefit of this new syntax is […]

Learn More

Apple Mac Keyboard Shortcuts and Symbols

Hi there, How many times have you looked at the Apple menu or some instructions and wondered what the keyboard symbols mean? I have been using Apple products for about 20 years now and still wonder what the little option symbol relates to on the keyboard. Here is a quick-reference that hopefully will assist some […]

Learn More

How to create a react-navigation StackNavigator

In a web browser, you can link to different pages using an anchor (<a>) tag. When the user clicks on a link, the URL is pushed to the browser history stack. When the user presses the back button, the browser pops the item from the top of the history stack, so the active page is […]

Learn More

Leave a Reply

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