0
comment
on 12/11/2015 8:06 AM
How do you inherit from a “class” in javascript Especially if you have a class that is a mix of constructor function and prototype methods and properties. "use strict"; function getSeq(start){ return function next(){ return start++; }; } var getId = getSeq(1); function Mammal(name){ var self = this; var id = getId(); // private variable this.getId = function(){ return id; }; Object.defineProperty(this, 'name', { // we want name to be mutable get:function (){ r[...]
>> Read the full article on assertfail.gewalli.se
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper