我已将我的 JavaScript 函数定义如下:
function printCompanyName(company1, company2, company3, company4, company5)
{
document.write("<p>" + company1 + "</p>");
document.write("<p>" + company2 + "</p>");
document.write("<p>" + company3 + "</p>");
document.write("<p>" + company4 + "</p>");
document.write("<p>" + company5 + "</p>");
}
并将其称为如下:
printCompanyName("Dell, Microsoft, Apple, Gizmodo, Amazon");
但我得到以下输出:
Dell, Microsoft, Apple, Gizmodo, Amazon
undefined
undefined
undefined
undefined
是什么赋予了!?我一直试图弄清楚这一点。我想:
Dell
Microsoft
Apple
Gizmodo
Amazon