with(PersonClass = function(){
    console.log("Person created!")
})
{
    prototype =
    {
        name : "John Doe"
    }
}

Другие, не менее интересные способы: http://stackoverflow.com/questions/19977298/create-class-by-merging-function-and-object-in-one-statement-alternative-way-to

UPD:

with(BlockingCenteredWindow = function()
{
  
    var instances_counter = 0

    return (function()
    {
      this.id = ++instances_counter
    })

}())
{
    prototype.render = function()
    {
        console.log(this.id)
    }
}
[ ]
 

P.S. Присылайте криптовалюту если вам нравится то, что я делаю.
Если не нравится - тоже присылайте.
LTC (Litecoin): LLN6X2uV1iuQ1e4tdmQZsf2RRwh4pxPSej

Leave a Reply

*