Last active
September 30, 2020 23:20
-
-
Save deltakosh/7fbeb3384ae1bef600de52dc0197e22d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Particle { | |
private _alpha: number | undefined; | |
private _beta: number | undefined; | |
public get alpha(): number { | |
if (this._alpha === undefined) { | |
this._alpha = Math.random() > 0.5 ? 2 : 3; | |
} | |
return this._alpha; | |
} | |
public get beta(): number { | |
if (this._beta === undefined) { | |
this._beta = Math.random() > 0.5 ? 2 : 3; | |
} | |
return this._beta; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment