0
我的文件中./functions/login_registration_functions.js
的NodeJS - 我的方法不執行
我有以下代碼
var methods = {
check_if_not_null: function (item_to_be_checked, item_to_store_the_checked_item) {
if(item_to_be_checked != null){
item_to_store_the_checked_item = item_to_be_checked;
}
}
};
module.exports = methods;
,我稱之爲我的routes.js
文件
var log_reg_funcs = require('./functions/login_registration_functions.js');
,我裏面打電話給我的put
裏面的方法
log_reg_funcs.check_if_not_null(req.body.title, request.title);
但它不起作用。當我下面替換上面代碼:
if(req.body.title != null){
request.title = req.body.title;
}
它工作正常
爲什麼我在這裏失蹤?
它的工作,感謝闡述 –