例えば
var contents = 'some text';
function fileSave(path){
// I'll handle saving the file, but I need the file contents
}
contents.fileSave('index.html');
したがって、関数がcontents変数で楽しい場合、関数は変数にアクセスできます。JavaScriptでreplace()がどのように機能するかと同じです。
元。
str.replace();
しかしこの場合
contents.fileSave();
変数は交換可能であり、関数は任意の変数に適用されます。
すみません、初心者..