Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Expression(label,expression){
- this.label = label;
- this.expression = expression;
- this.calculate();
- }
- Expression.prototype.calculate = function(){
- this.value = this.expression();
- }
- var a = new Expression('dave', function(){
- return 'foo' + 'bar';
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement