簡體   English   中英

如何為參數 [word] 的長度創建返回語句?

[英]How do I make a return statement for the length of parameter[word]?

對參數word的長度做一個返回語句

module.exports = function x1(word) {
     return x1.length;
};


module.exports = function x1(word) {
     var w = x1.length
     return w;
};

我都試過了,都沒有給我任何結果。

你計算的不是“詞”。 嘗試這個:

module.exports = function x1(word) {
     return word.length;
};

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM