function sayHello
(first : String,
last : String,
named initial : String = "") : String {
var fullname : String;
if (initial <> "") {
initial = initial + ". ";
}
fullname = first + " " + initial + last;
return fullname;
}
document.write (sayHello ("Scott", "Duffy") + "<br>");
document.write (sayHello ("Bobby", "Jones", initial:"H") + "<br>");求教named关键字的语法

解决方案 »

  1.   

    能say Hello吗?
    但这也许还真是一种特定语法,恳请LZ赐教,大家学学,反正JS现在都鸟语花香了............
      

  2.   

    再请LZ赐教,这是啥语言,“<>”or “!=”?或者给个网址 ABOUT THE LANGUAGE
      

  3.   

    没注意您的问题 非常抱歉
    是一本书上的代码
    HowtoDoEverythingwithJavaScript
    McGrawHill著
    才开始看就遇到这个问题..郁闷
      

  4.   

    Use the Improvements in JavaScript 2.0
    to Create More Powerful Functions-_-!