output an array without for or while loop


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var arr = [[1,2,3],[5,4,3],[7,6,5]];
  2. var out= (function($){
  3. return $.length? String($[0]).concat("\n").concat(arguments.callee($.slice(1))): "";
  4. })(arr);
  5. alert(out);
  6. /*output: 1,2,3
  7.   5,4,3
  8.   7,6,5
  9. */

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.