I want to define public and private property in JavaScript class,
Here you see c# format of my properties.
My question is 'How can I write these properties with JavaScript':
public class MyMath
{
public static double Pi
{
get {return 3.14;}
}
public static int R {get; set;}
private int MyPrivateProp1 {get; set;}
public double MyCalcMethod()
{
return MyPrivateProp1 * R;
}
}
I want to use this class like:
var x = MyMath.Pi * MyMath.R;
Thanks in advance for your time.