小编kou*_*sha的帖子

Sublime Text 2/Sublime Text 3在osx上恢复未保存的文件

在崇高中,我知道即使你以后没有将更改保存在文件中,也可以从你离开的地方开始.我在sublime中打开了一个新选项卡,并在保存文件之前关闭了应用程序.sublime是否在计算机中的某处保存临时文件(我正在使用MAC OSx)

macos sublimetext sublimetext2 sublimetext3

13
推荐指数
3
解决办法
2万
查看次数

节点js重写toString

我试图覆盖我的对象的默认toString方法,这是代码和问题:

function test (){
     this.code = 0;//later on I will set these
     this.name = "";
}

test.prototype.toString= function(){
    return this.name + "\t"+ this.code +" \t "+this.anotherFunction();
}

console.log (Lion.toString()); //works correct i.e. calls my function
console.log (Lion); //doesn't call my function. Prints { code: 0, name: 'jack' }
Run Code Online (Sandbox Code Playgroud)

是不是默认情况下调用toString?

node.js

7
推荐指数
3
解决办法
4122
查看次数

标签 统计

macos ×1

node.js ×1

sublimetext ×1

sublimetext2 ×1

sublimetext3 ×1