<!DOCTYPE html> 
  <html> 
  <head> 
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
  <title>每天一个JavaScript实例-递归实现反转数组字符串</title> 
  <script> 
  var func = function(x,indx,str){ 
    return indx == 0 " " + x[indx]));; 
    } 
  var arr = new Array("apple","banna","orange","apple2","apple3"); 
  var arr1 = arr.slice(0) 
  var arr3 = func(arr1,arr1.length,""); 
  var arr2 = arr.slice(0).reverse(); 
  console.log(arr2); 
  console.log(arr); 
  console.log(arr3); 
   
  </script> 
  </head> 
   
  <body> 
   
  <div id = "date"> 
  </div> 
   
  </body> 
  </html> 
标签:
递归,反转数组,字符串

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com