• CoffeeScript 详解 at March 19, 2016

    类的部分写错了 _price 部分 换一下输出顺序就能看出

    iphone = new Gadget("iphone", 4999)
    ipad = Gadget.create("ipad", 3999)
    
    console.log iphone.sell() #=> "Buy iphone with 3999 in beijing"
    console.log ipad.sell() #=> "Buy ipad with 3999 in beijing"