1.為什么外部這個J沒有賦值成功,而是返回了nan?<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script type="text/javascript"> var j; function indexx(index) { if(index == 1) { return 1; } j= index * indexx(index - 1); } indexx(4); console.log(j); </script> </body></html>
為什么這個遞歸函數這個變量j等于nan?
慕桂英3389331
2019-03-14 14:15:11