daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Count numbers and output one char at time
  2. var s = '';
  3. for (var i = 1; i <= 42; i++) s += i.toString();
  4.    
  5. for (var i = 0; i < s.length; i++) {
  6.   // output s[i]
  7. }
  8.    
  9. var str = number.toString(); // the current number as you're looping through
  10. for (var k = 0; k < str.length; k++) {
  11.     var oneLetterAtATime = str.charAt(k); // get the digits one at a time
  12.     output += "<td>" + oneLetterAtATime + "</td>";
  13. }
  14. number++;
  15.    
  16. if (k > 0) {
  17.     j++;
  18. }
  19.    
  20. var t = '';
  21. var limit=100;
  22. for (var j = 1; j<= limit; j++) t += j.toString();
  23.  
  24. var output='';
  25. for (var j = 0; j < t.length; j++) {
  26.   output=output+','+t[i];
  27. }
  28. alert(output);
  29.    
  30. rows = 3;
  31. columns = 19;
  32. number = 1;
  33. var str = "";
  34. output = '<table style="width:100%;">';
  35. for(var i = 0; i < rows; i++) {
  36.     output += "<tr>";
  37.     for(var j = 0; j < columns; j++) {
  38.         output += "<td>" + number + "</td>";
  39.         str +=number;
  40.         number++;
  41.     }
  42.     output += "</tr>";
  43. }
  44. output += "</table>";
  45. $("#game").html(output);
  46.  
  47. var strvalue="";
  48.  
  49. $.each(str, function(e,v){
  50.     if (e > 0){
  51.         strvalue = strvalue + ", "+ v;
  52.     }
  53.     else{
  54.     strvalue += v;
  55.     }
  56. });
  57.  
  58. alert(strvalue);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top