JS

xiaoxiao2021-03-18  217

/ / ================== ==========================

VAR VACTORIAL = Function () {

Var obj = new object ();

Obj.total = 1;

Obj.Start = Function (R) {

IF (! / ^ / d $ /. TEST (R)) {return "Please enter the positive integer!";

Obj.total = obj.total * r;

IF (r> 1) {

Obj.Start (R-1);

}

Return Obj.total;

}

Return Obj;

}

VAR v = new Vactorial ();

Alert (v.start (0));

转载请注明原文地址:https://www.9cbs.com/read-129967.html

New Post(0)