function Picker() { this.status = [0, 0, 0]; Object.defineProperty(this, 'progress', { get : function(){ return this.status[0] }, set : function(p){ this.status[0] = p }, enumerable : true }); } var picker = new Picker(); picker.progress = 2; console.log(picker.status[0]) // logs 2
public static void main(String[] args) { int[] source = {8,3,5,9}; Picker picker = new Picker(source); for(int i = 0; i<4;i++) { System.out.println(picker.next()); } }
picker = new Picker(this); setInteractiveBehavior(new InteractiveBehavior(this));