I have a question about jquerymx. I want to make public law that some method in the deck class because it will be used for other classes. Example) I think the pushback deck is a private method in class. So I want to convert it to the public. How do I solve this problem?
deck: function () {these.elements = []; // pushback: function (element) // {// this.elements.push (element); //} this.push_back = function (element) {this.elements.push (element); } This.push_front = element {element} {this.elements.unshift (element); } This.pop_back = function () {return this.elements.pop (); } This.pop_front = function () {return this.elements.shift (); } This.peek_back = function () {Come back to it. Edit [this.elements.length-1]; } This.peek_front = function () {this return.elements [0]; } This.isEmpty = function () {return this.elements.length === 0; } This.getElements = function (number) {return it. Article [number]; } This.Length = function () {This return.elements.length; }}
Any answer Thanks.
Edit:
Widget.js
(function ($, s) {SCL ('widget', {init: function () {}, Deck: function () {this.elements = []; push_back = (function) {this.elements.push (element););) Tie (this); push_french = (function (element) {This.elements.unshift ();}); Tie (this); pop_back = (function () return to {this.elements.pop ();) Tie (it); pop_french = (function () { This.elements.shift ();}) .bind (this); peek_back = (function () {return it. [Edit this.elements.length- 1];}). Bind (this); peck_front = ( Function () {Return to it. [0];}). Tie (this); FC = (Function () {return it; elements} length === 0;}) .bend (this); getElements = (function (number) {return it. Article [number];.}) This dam (); Length = (function () {return it. Allements.length;}). Bind (this);}); }) (JQuery, ...);
------. Js
(function ($, S) {S.Widget ('-----,' Init: function () {this.tempDeque = new this.deque ();}, Setup: Function () {.... (var i = 0; i & lt; 10; i ++) {..... This is .tempDeque.push_back (i); /// This error is. }}})}} (JQuery, ...);
Comments
Post a Comment