final protected in JavaScript

V

VK

Given this simplified to the min constructor:

function jsFileManager(mode) {
this.mode = mode;
}

If there a way to make jsFileManager.mode property as final protected.
Other words, it can be set only once diring the objects initialization
and it is accessible only to the inner methods of jsFileManager
conctructor ?
 
T

Thomas 'PointedEars' Lahn

VK said:
function jsFileManager(mode) {
this.mode = mode;
}

If there a way to make jsFileManager.mode property as final protected.

Not in JavaScript < 2 (Epimetheus)/JScript < 7 (.NET).

<http://www.mozilla.org/js/language/js20/core/definitions.html#attribute>
Other words, it can be set only once diring the objects initialization
and it is accessible only to the inner methods of jsFileManager
conctructor ?

You can make it a local variable to achieve the latter.

I suggest you let identifiers of constructors start with a capital
character: JSFileManager.


PointedEars
 
L

Luke Matuszewski

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top