引数[i]を使用してすべての関数引数の値をループして電子メールの検証を簡素化したいが、 "undefined"を返す。関数引数の値を取得する方法は?
function checkInputRequired(companyNameValue, contactNameValue, publisherEmailValue, publisherEmailConfirmValue)
{
// The arguments object is an Array-like object corresponding to the arguments passed to a function.
for (var i = 0; i < arguments.length; i++)
{
// print out 4 undefined
console.log(arguments[i]);
}
}
どの引数をテストしていますか?私に教えてはいけない、あなたは、任意の引数を提供していない... – Xufox